Parameter
Uses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case-insensitive. For more information on regular expressions, including escape sequences, anchors, and modifiers, see Using Regular Expressions in Functions in the Developing ColdFusion Applications.
Depends on the value of the returnsubexpressions__parameter:
REFindNoCase(reg_expression, string [, start, returnsubexpressions, scope])
Parameter |
Description |
---|---|
reg_expression |
Regular expression for which to search. Case-insensitive.For more information, see Using Regular Expressions in Functions in the Developing ColdFusion Applications. |
string |
A string or a variable that contains one. String in which to search. |
start |
Optional. A positive integer or a variable that contains one. Position at which to start search. The default value is 1. |
returnsubexpressions |
Optional. Boolean. Whether to return substrings of reg_expression, in arrays named len and pos:
|
scope |
Optional
|
This function finds the first occurrence of a regular expression in a string. To find the second and subsequent instances of the expression or of subexpressions in it, you call this function more than once, each time with a different start position. To determine the next start position, use the returnsubexpressions__parameter, and add the value returned in the first element of the length array to the value in the first element of the position array.
<cfscript> // when start=1, returnSubexpressions=true, and scope="one" writeDump(REFindNoCase("[0-9][A-Z][a-z]+", "ColdFusion 123Cold 789Fusion!",1,true,"one")); </cfscript>
Output
<cfscript> // when start=1, returnSubexpressions=true, and scope="all" writeDump(REFindNoCase("[0-9][A-Z][a-z]+", "ColdFusion 123Cold 789Fusion!",1,true,"all")); </cfscript>
Влезте във вашия акаунт