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, string=string, start=number, returnSubExpressions=boolean, scope=string, multiline=boolean );
Returns: any
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(".*", ""));
<span class="nv">teststring1</span> <span class="o">=</span> <span class="s2">"The cat in the hat hat came back!"</span><span class="p">;</span>
<span class="nv">st1</span> <span class="o">=</span> <span class="nf">REFind</span><span class="p">(</span><span class="s2">"(['[:alpha:]']+)[ ]+(\1)"</span><span class="p">,</span><span class="nv">teststring1</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="s2">"TRUE"</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">st1</span><span class="p">[</span><span class="s1">'len'</span><span class="p">][</span><span class="m">3</span><span class="p">]);</span>
<span class="nv">teststring2</span> <span class="o">=</span> <span class="s2">"AAAXAAAA"</span><span class="p">;</span>
<span class="nv">st2</span> <span class="o">=</span> <span class="nf">REFind</span><span class="p">(</span><span class="s2">"x"</span><span class="p">,</span><span class="nv">teststring2</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="s2">"TRUE"</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nf">arrayLen</span><span class="p">(</span><span class="nv">st2</span><span class="p">[</span><span class="s1">'pos'</span><span class="p">]));</span>
See also
- Strings
- Regex
- string.reFindNoCase()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)