Rereplacenocase - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

REReplaceNoCase

Description
Uses a regular expression to search a string for a string pattern and replace it with another. The
search is case-insensitive.
Returns
If
scope = "one"
by the value of substring.
If
scope = "all"
the value of substring.
If the function finds no matches: returns a copy of the string, unchanged.
Category
String functions
Function syntax
REReplaceNoCase(string, reg_expression, substring [, scope ])
See also
REFind, REFindNoCase, Replace,
History
ColdFusion MX: Changed behavior: 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").
Parameters
Parameter
string
reg_expression
substring
scope
Usage
For details on using regular expressions, see
in Developing ColdFusion MX Applications.
Example
<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"):
666
Chapter 3: ColdFusion Functions
: returns a string with the first occurrence of the regular expression replaced
: returns a string with all occurrences of the regular expression replaced by
ReplaceList
Description
A string or a variable that contains one.
Regular expression to replace. For more information, see
Regular Expressions in Functions,"
A string or a variable that contains one. Replaces
: Replace the first occurrence of the regular expression. Default.
one
: Replace all occurrences of the regular expression.
all
in Developing ColdFusion MX Applications.
Chapter 7, "Using Regular Expressions in Functions,"
Chapter 7, "Using
.
reg_expression

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents