REReplaceNoCase(string, reg_expression, substring [, scope ])

Description

Returns string with a regular expression replaced with substring in the specified scope. The search is case-insensitive.

Category

String functions

See also

REFind, REFindNoCase, Replace, ReplaceList

Parameters

Parameter
Description
string
A string.
reg_expression
Regular expression to replace. Can include POSIX-specified character classes (for example, [:alpha:], [:digit:], [:upper:], and [:lower:]).
substring
String replacing reg_expression.
scope
Defines how to complete the replace operation:
  • ONE Replace only the first occurrence (default).
  • ALL Replace all occurrences.

Example

<!--- This example shows the use of REReplaceNoCase --->
<html>
<head>
<title>REReplaceNoCase Example</title>
</head>
<body bgcolor = silver>
<H3>REReplaceNoCase Example</H3>
<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>
</body>
</html>