I am trying to strip out any html code of images from content if the image path is within a specific directory.
Take for example this block of content:
Donec iaculis <img src="http://www.domain.tld/smilies/butterfly.gif" alt="butterfly.gif" /> arcu pretium elementum et posuere felis. <img alt="mrgreen.gif" src="http://www.domain.tld/smilies/mrgreen.gif" /> Duis sit amet erat vitae tellus eleifend varius. <img src="http://www.domain.tld/avatars/somedude.jpg" /> Pellentesque ac ligula
What I am after is:
Donec iaculis arcu pretium elementum et posuere felis. Duis sit amet erat vitae tellus eleifend varius. <img src="http://www.domain.tld/avatars/somedude.jpg" /> Pellentesque ac ligula
In this example I would need to have the two images's removed that contain /smilies/
and leave the one img that exists within the /avatars/
path.
Note that the alt="" is in two different locations on the two images it matches.