I am very new to regular expressions. I have a senario in my java script where i m using regular expression. i have a long html string contain tags like
1. <IMG src="path/myImage1.jpg" alt="blah" border="0"/>
2. <IMG src="path/myImageTwo.jpg" alt="xyz" border="0"/>
and there are some other <IMG../> tags which contains button like two below
3. <IMG src="path/buttonRed.jpg" alt="blah" border="0"/>
4. <IMG src="path/buttonBlue.jpg" alt="blah" border="0"/>
I need to remove all the <IMG src.../> tags from the html string i have that DOESN'T contain button in the tag, i.e. I need to remove 1 & 2 but NOT 3& 4
I have my regular expression </?[iI][mM][gG][ ][^>]*> but that removes all <IMG src../> tags. I m looking for something with negative lookaheads. But i was not able to find the right solution. Any help will greatly appreciated.