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 [, scope ] ] ] )

Returns: any

Argument Description Default
reg_expression
string, required

Regular expression for which to search. Case-insensitive.

string
string, required

String in which to search.

start
number, optional

A positive integer. Position in the string at which to start search. The default value is 1.

1

returnsubexpressions
boolean, optional

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.

scope
string, optional

Examples

writeDump(REFindNoCase("a+c+", "abcaaCCdd"));
	writeDump(REFindNoCase("a+c*", "AbcaAcCdd"));
	writeDump(REFindNoCase("[\?&]rep = ", "report.cfm?rep = 1234&u = 5"));
	writeDump(REFindNoCase("a+", "baaaA"));
	writeDump(REFindNoCase(".*", ""));
	teststring1 = "The cat in the hat hat came back!";
	st1 = REFind("(:alpha:+)[ ]+(\1)",teststring1,1,"TRUE");
	writeDump(st1['len'][3]);
	teststring2 = "AAAXAAAA";
	st2 = REFind("x",teststring2,1,"TRUE");
	writeDump(arrayLen(st2['pos']));

See also