REFindNoCase
811
Usage
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.
Example
<h3>REFindNoCase Example</h3>
<p>This example demonstrates the use of the REFindNoCase function with and
without the <i>returnsubexpressions</i> parameter set to True.</p>
<p>If you do not use the <i>returnsubexpressions</i> parameter, REFindNoCase
returns the position of the first occurrence of a regular expression
in a string starting from the specified position. Returns 0 if no
occurrences are found. </p>
<p>REFindNoCase("a+c+", "abcaaccdd"):
<cfoutput>#REFindNoCase("a+c+", "abcaaccdd")#</cfoutput></p>
<p>REFindNoCase("a+c*", "abcaaccdd"):
<cfoutput>#REFindNoCase("a+c*", "abcaaccdd")#</cfoutput></p>
<p>REFindNoCase("[[:alpha:]]+", "abcaacCDD"):
<cfoutput>#REFindNoCase("[[:alpha:]]+", "abcaacCDD")#</cfoutput></p>
<p>REFindNoCase("[\?&]rep = ", "report.cfm?rep = 1234&u = 5"):
<cfoutput>#REFindNoCase("[\?&]rep = ", "report.cfm?rep = 1234&u = 5")#
</cfoutput></p>
<!--- Set startPos to one; returnMatchedSubexpressions = True --->
<hr size = "2" color = "#0000A0">
<p>If you do use the <i>returnssubexpression</i> parameter, REFindNoCase
returns
the position and length of the first occurrence of a regular expression
in a string starting from the specified position. The position and length
variables are stored in a structure. To access position and length
information, use the keys <i>pos</i> and <i>len</i>, respectively.</p>
<cfset teststring = "The cat in the hat hat came back!">
<p>The string in which the function is to search is:
<cfoutput><b>#teststring#</b></cfoutput>.</p>
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
:
•
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.
Parameter
Description
Содержание COLFUSION MX 7 - INSTALLING AND USING COLDFUSION MX
Страница 1: ...COLDFUSION MX7 CFML Reference...
Страница 20: ...20 Chapter 1 Reserved Words and Variables...
Страница 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Страница 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Страница 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Страница 311: ...cfNTauthenticate 311 Please Try again H2 cfif cfoutput cfinclude template loginform cfm cfabort cfif cfif cflogin...
Страница 411: ...cftable 411 cftable body html...
Страница 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Страница 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Страница 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Страница 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Страница 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Страница 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 693: ...IsWDDX 693 struct data wddxPacket hr xmp cfoutput packet xmp IsWDDX returns IsWDDX packet br cfoutput...
Страница 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Страница 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 869: ...StructIsEmpty 869 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 903: ...Val 903 value Is the beginning numeric name form...
Страница 932: ...932 Chapter 3 ColdFusion Functions...
Страница 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Страница 962: ...962 Chapter 5 Application CFC Reference...
Страница 1008: ...1008 Chapter 6 ColdFusion MX Event Gateway Reference cfset retValue Reason reason cfreturn retValue cffunction...
Страница 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...