I am trying to select text using regular expressions, leaving the tags imgintact.
I found the following code that selects all tags img:
/<img[^>]+>/g
but actually has the following text:
This is an untagged text.
<p>this is my paragraph text</p>
<img src="http://example.com/image.png" alt=""/>
<a href="http://example.com/">this is a link</a>
using the code above, select the img tag only
/<img[^>]+>/g
<img src="http://example.com/image.png" alt=""/>
but I would like to use some regex that selects everything except the image:
/magical regex/g
This is an untagged text.
<p>this is my paragraph text</p>
<a href="http://example.com/">this is a link</a>
I also found this code:
/<(?!img)[^>]+>/g
which selects everything tagsexcept img. but in some cases I will have unlabeled text or text between tags, so this will not work for my case .:(
?
, , , , .
UPDATE:
, , , , , , .
, - , Yahoo Pipes, . .
, , regex yahoo:
http://pipes.yahoo.com/pipes/docs?doc=operators#Regex
2
img, , @Blixt, :
<(?!img)[^>]+> , replace with ""
(?s)^[^<]*(.*), replace with $1
(?s)^([^>]+>).*, replace with $1
, img, - , , .