reFindNoCase
Uses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case-insensitive.
reFindNoCase(reg_expression, String [, start] [, returnsubexpressions]) → returns any
Argument Reference
reg_expression string Required
string string Required
A string or a variable that contains one. String in which to search.
start numeric
Default: 1
1
returnsubexpressions boolean
Default: false
false
True: if the regular expression is found, the first array element contains the length and position, respectively, of the first match. 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, the arrays each contain one element with the value 0. False: the function returns the position in the string where the match begins. Default.
Values:
truefalse
scope string
Default: one
one
CF 2016+ * one: returns the first value that matches the regex. * all: returns all values that match the regex.
Values:
oneall
Examples Sample code invoking the reFindNoCase function
reFindNoCase("E", "test 123!") Expected Result: 2
CF 2016+ example with all optional arguments
serializeJSON(reFindNoCase("E", "test 123!", 1, true, "ALL")) Expected Result: [{ "len":[1], "match":["e"], "pos":[2]}]
© 2012–present Foundeo, Inc. and the CFDocs contributors.
Licensed under the MIT License.
ColdFusion is a trademark of Adobe Systems Incorporated.
https://cfdocs.org/refindnocase