Forum Moderators: mack
I have many codes I'm trying to search + replace. Here's an example:
<A href="http://www.fruits.net/click-1963151-10399388" target=_blank>Fruits are good</A>* - Fruits are healthy and good for you.<IMG height=1 src="http://www.banana.com/image-1963151-10399388" width=1 border=0>
I want to search for everything between
<IMG height=1 src="http://www.banana.com/image-1963151-10399388" width=1 border=0>
so I went to dreamweaver and searched this:
<A href="http://www.fruits.net/click-1963151-10399388" target=_blank>Fruits are good</A>* - Fruits are healthy and good for you.<
I thought the regular expression
I'd appreciate any help!
It's hard to tell just what you wrote, due to the reformatting. However, I assume you used .* to match everything inside the IMG tag.
. matches "any character". * says match 0 or more of the previous character (e.g. "any character").
The problem is that * is "greedy". It wants to match the LONGEST string possible. So, it would match everything up to the LAST ">" in your file!
Instead of .* you need to use (hope this comes out...):
[^>]*
This says match a string of 0 or more of any character other than >. So, the match will stop just before the first >, rather than the last >.