Here's a stab rereplace(mystring,"(>[^<]*)(#escapedsearchstring#)","\1<b>\2</b>","ALL")
Assumes the search is in an html fragment - will only find instances of the string after a >. Blair On Dec 6, 2007 2:33 PM, Adam Chapman <[EMAIL PROTECTED]> wrote: > > Hi All, > > Wondering if regex wizards out there can help me with this.. > > I want to replace a substring within a string, but ONLY if its is not a > name/attribute of a html tag. (Between a matching pair of < > ) > > Below is some code to illustrate the problem.. > > <cfset myString = 'I am throwing a <span > style="color:red;">spanner</span> in the works' /> > <cfoutput>#myString#<br /></cfoutput> > <cfset myString = replaceNoCase(myString,"span","<b>span</b>","all") /> > <cfoutput>#myString#<br /></cfoutput> > > This is for highlighting multiple search strings in search results. > > Thanks in advance for helping the regex impaired. > > Regards, > Adam > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---