got a bit of a head scratcher.
i've got this piece of code which changes any occurance of the word 'blah' inside a tag, with the word 'bleugh' (...except when it's in an <a> tag)
$html = preg_replace ("//(?!(?:[^<]+>|[^>]+<\/a>))(blah)/is", "bleugh", $html);
this is pretty close to what i need. but what i really want to do is change 'blah' to 'bleugh' ONLY when it's inside a <p> tag.
i can do this pretty easy when the example is just
<p>blah</p>
but i can't figure out how to do it when there are multiple cases of 'blah' inside a variety of different tags
<a href="blah.html">blah</a>
<p>the quick brown fox blah jumped over
in this second example, the only one i want to change is in the <p> tag on the second line... brown fox
blah jumped...