I've got this regex to search a string and replace a specific image if found, but the regex replace never works.
Here's the code I'm using.
var txt = '<img src="images/p.gif" alt="" onload="" />'+
'<img src="images/p2.gif" alt="" onload="" />'+
'<img src="images/p.gif" alt="" />';
var re = txt .replace(/<img src=\"images\/p\.gif\"[^>]*>/g, '');
alert(re);