![MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference Download Page 519](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-cfml-language/coldfusion-4-5-cfml-language_reference_3287257519.webp)
Chapter 2: ColdFusion Functions
495
length of the first instance of each subexpression within the regular expression are
returned in subsequent elements of the arrays.
Examples
<!--- This example shows the use of REFindNoCase --->
<HTML>
<HEAD>
<TITLE>
REFindNoCase Example
</TITLE>
</HEAD>
<BODY>
<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. In order to access the
position and length information, you must 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>
<P>The first call to REFindNoCase to search this string is:
<b>REFindNoCase("[[:alpha:]]+",testString,1,"TRUE")</b></P>
<P>This function returns a structure that contains two arrays: pos and
len.</P>
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...