Replacing text between, not within, tags
View the code for this demo.
The purpose of this example is to show how you could, using Cold Fusion, replace text within a block of HTML but only affect the text that is visible and not part of any HTML tag.
Output with replaced text
<a href="/meta/RSS.xml > test</a>" title="My RSS feed">Our Really Simple Syndication 2.0 feed</a>
The > in the href attribute of the above anchor tag is invalid,
but I want to show how this code doesn't cause the R.S.S. in
the title attribute to be replaced and how the code isn't tricked
by the extra closing anchor tag (</a>) within the href attribute.
5 < 10 - Really Simple Syndication > 15
This is to demonstrate that random opening characters won't cause the
code to fail to replace, since it only excludes properly formatted
<img src="RSS.jpg" title="RSS" /><br />
This is our <strong class="RSS">Really Simple Syndication</strong> feed.