Hey
I’m having some problems with the eregi_replace() function. I can’t seem to get my regex pattern to match the text that I’m trying to replace. Is there anything obvious that’s causing the problem?
Here’s the patter:
$output = eregi_replace('<p class="submission">s*<a href="http://www.deviantart.com/deviation/d*/"><span class="shadow"><img src="http://thumbs.deviantart.com/[a-zA-Z0-9]*" width="d*" height="d*" alt=".*" /></span></a>s*</p>', '', $output);
And here’s an example of what I’m trying to match:
<p class="submission">
<a href="http://www.deviantart.com/deviation/9854054/"><span class="shadow"><img src="http://thumbs.deviantart.com/300W/fs4.deviantart.com/i/2004/230/6/f/peurto_rico_flowers_two.jpg" width="300" height="225" alt="" /></span></a>
</p>
I’ve also tried this pattern to no avail:
$output = eregi_replace('(<a [^<]*href=["|']?([^ "']*)["|']?[^>].*>([^<]*)</a>)<span class="shadow"><img src="[^http://thumbs]" width="[0-9]" height="[0-9]" alt="[a-zA-Z0-9]" /></span></a>', '', $output);
Anyone see where I’m going wrong?