[thelist] regex for highlighting search terms in coldfusion

Sarah Adams mrsanders at designshift.com
Fri Jan 27 12:27:32 CST 2006


I'm trying to write a ColdFusion script that will highlight search terms 
within a string. It works great unless there are HTML tags in the string 
and the search terms appears inside one of the tags. My basic 
highlighting replace function looks like this:

<cfset hi = ReplaceNoCase(str,"#term#","<strong>#term#</strong>","all")>

Can someone tell me how to change this to a ReplaceRENoCase that will 
not replace "term" if it is between "<" and ">"? I've tried Googling to 
no avail.

TIA

--
sarah adams
web developer & programmer
portfolio: http://sarah.designshift.com
blog: http://hardedge.ca



More information about the thelist mailing list