Uses a regular expression to search a string for a string pattern and replace it with another. The search is case-insensitive.
scope = "one"
: returns a string with the first occurrence of the regular expression replaced by the value of substring.
scope = "all"
: returns a string with all occurrences of the regular expression replaced by the value of substring. REReplaceNoCase(string, reg_expression, substring [, scope ])
REFind,
REFindNoCase,
Replace,
ReplaceList
New in ColdFusion MX: this function inserts the following special characters in regular expression replacement strings, to control case conversion: \u, \U, \l, \L, and \E. If any of these strings is present in a ColdFusion 5 application, you must insert a backslash before it (for example, change "\u" to "\\u").
To include a backslash character in a parameter of this function, you must precede it with another backslash, as an escape character.
<p>The REReplaceNoCase function returns <i>string</i> with a regular expression replaced with <i>substring</i> in the specified scope. This is a case-insensitive search. <p>REReplaceNoCase("cabaret","C|B","G","ALL"): <cfoutput>#REReplaceNoCase("cabaret","C|B","G","ALL")#</cfoutput> <p>REReplaceNoCase("cabaret","[A-Z]","G","ALL"): <cfoutput>#REReplaceNoCase("cabaret","[A-Z]","G","ALL")#</cfoutput> <p>REReplaceNoCase("I LOVE JELLIES","jell(y|ies)","cookies"): <cfoutput>#REReplaceNoCase("I LOVE JELLIES","jell(y|ies)","cookies")# </cfoutput> <p>REReplaceNoCase("I LOVE JELLY","jell(y|ies)","cookies"): <cfoutput>#REReplaceNoCase("I LOVE JELLY","jell(y|ies)","cookies")# </cfoutput>