Hi,
I have a preg_replace that finds images tags:
/<img src="(.)"(.)\/>/isUe
It works great but I would like to only match if the image tag is NOT inside a hyperlink. So i added this lookahead: /<img src="(.)"(.)\/>(?![\s]<\/\sa>)/isUe
For some reason the lookahead is taking the match past the img tag's />, passing the </a> and matching at the following />.
For example this pattern will match when it shouldn't:
<img /></a><br />
Without the lookahead it matches the img tag just fine.
Any help would be appreciated!
Thanks,
slevytam