Is there a way to replace strings (text) outside HTML tags? I'm trying to accept a block of HTML content (could include CSS/JavaScript) and be able to replace several words or characters only outside HTML tags. So for example I would be able to accept this:
<h4>
<a href="/article/domains-launched-icann">New Top Level Domains Launched by ICANN</a><br />
<span class="credit">by Derek Vaughan - Apr 3rd, 2004</span>
</h4>
<div class="art">
<a href="/article/domains-launched-icann"><img src="http://www.SitePoint.com/graphics/author_derek.jpg" width="56" height="67" alt="Derek Vaughan" /></a>
<p>[b]ICANN[/b] recently released the details of 9 new TLD proposals. The proposals come from all corners of the globe, and all areas of commerce. [b]Derek[/b] outlines each in detail, and preempts the potential for an [b]Internet[/b] land-grab when the approved names become official...</p>
And change it to...
<h4>
<a href="/article/domains-launched-icann">New Top Level Domains Launched by ICANN</a><br />
<span class="credit">by Derek Vaughan - Apr 3rd, 2004</span>
</h4>
<div class="art">
<a href="/article/domains-launched-icann"><img src="http://www.SitePoint.com/graphics/author_derek.jpg" width="56" height="67" alt="Derek Vaughan" /></a>
<p>[b]CHANGE 1[/b] recently released the details of 9 new TLD proposals. The proposals come from all corners of the globe, and all areas of commerce. [b]CHANGE 2[/b] outlines each in detail, and preempts the potential for an [b]CHANGE 3[/b] land-grab when the approved names become official...</p>
Thanks!