making preg_replace not working inside html
<p>I am struggling.. 
I use this simple code for searching words in text and add relevant texts:</p>

<pre><code>$search=array("/\bword1\b/","/\bword2\b/","/\bword3\b/");
$replace=array("&lt;a href='link1'&gt;word1&lt;/a&gt;",ecc);
preg_replace($search,$replace,$myText);
</code></pre>

<p>Problem comes when one of the search pattern is found between a html inside $myText. Example:</p>

<pre><code>$myText="blablablabla &lt;strong class="word1"&gt;sad&lt;/strong&gt;";
</code></pre>

<p>As you can see word1 is a css class for the link. If i run the preg_replace will destroy every markup there.</p>

<p>How can I edit my $search pattern for not matching inside html, something like: [^&lt;.?*>] ?</p>

<p>Thanks</p>
