I am currently using PHP to parse emails. I am able to save both attached and embedded images; however, embedded images are given an irritating "CID" source that results in a broken image link.
I want to parse these out completely, but leave images that have actual web addresses associated.
In other words, <img src = "http://example.com/images/someimage.jpg">
needs to stay. But, <img src = "cid:ii_id8bx9qh0_14f205b0a5e7738a">
needs to go.
Now, I could use strops to find the start and end, and that would be okay... except that certain email clients also embed things like width, height, and ID - and they put them in haphazard order.
So, I need a regex that looks for a start of <img
, that contains src="cid
, all the way to the end of the image tag.
Bonus points if it's case insensitive.
Thanks for your help!