User Guide

REFind 651
REFind
Description
Uses a regular expression (RE) to search a string for a pattern. The search is case sensitive.
For more information on regular expressions, including escape sequences, anchors, and modifiers,
see Chapter 7, “Using Regular Expressions in Functions, in Developing ColdFusion MX
Applications.
Returns
Depends on the value of the returnsubexpressions parameter:
If returnsubexpressions = "False":
The position in the string where the match begins
0, if the regular expression is not matched in the string
If returnsubexpressions = "True": a structure that contains two arrays, len and pos. The
array elements are as follows:
If the regular expression is found in the string, the first element of the len and pos arrays
contains the length and position, respectively, of the first match of the entire regular
expression.
If the regular expression contains parentheses that group subexpressions, each subsequent
array element contains the length and position, respectively, of the first occurrence of each
group.
If the regular expression is not found in the string, the first element of the len and pos
arrays contains 0.
Category
String functions
Function syntax
REFind(reg_expression, string [, start ] [, returnsubexpressions ] )
See also
Find, FindNoCase, REFindNoCase, REReplace, REReplaceNoCase
Parameters
Parameter Description
reg_expression Regular expression for which to search. Case-sensitive.
string A string, or a variable that contains one, in which to search.