brazenskies
10-15-2008, 04:49 PM
I need to remove anything in image tags from a paragraph of text.
The paragraph currently looks like this...
here is a paragraph of some text <img src="image.jpg" /> and here is some more...
I need to strip out the whole img tag so I end up with this...
here is a paragraph of some text and here is some more...
I really know nothing about regExp and having trouble finding any solutions to this so hoping someone might be able to help.
I managed to come up with this, to strip replace everything that comes after the tag opener, but I need to somehow change it so that it includes everything again after the closing tag...
str = "here is a paragraph of some text <img src="image.jpg" /> and here is some more..."
set img = new RegExp
set endimg = new RegExp
img.pattern = "<img.*$"
gstr = img.replace(str,"")
Thanks in advance!
The paragraph currently looks like this...
here is a paragraph of some text <img src="image.jpg" /> and here is some more...
I need to strip out the whole img tag so I end up with this...
here is a paragraph of some text and here is some more...
I really know nothing about regExp and having trouble finding any solutions to this so hoping someone might be able to help.
I managed to come up with this, to strip replace everything that comes after the tag opener, but I need to somehow change it so that it includes everything again after the closing tag...
str = "here is a paragraph of some text <img src="image.jpg" /> and here is some more..."
set img = new RegExp
set endimg = new RegExp
img.pattern = "<img.*$"
gstr = img.replace(str,"")
Thanks in advance!