MACROMEDIA COLDFUSION 5 - CFML Reference page 589

Cfml reference
Hide thumbs Also See for COLDFUSION 5 - CFML:
Table of Contents

Advertisement

Alphabetical List of ColdFusion Functions
the regular expression in the first element of the respective arrays; the position and
length of the first instance of each subexpression within the regular expression are
returned in subsequent array elements.
Example
<!--- 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 =
</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 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:
<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:
5")#</cfoutput>
<cfoutput><b>#teststring#</b></cfoutput>.</P>
pos and len.</P>
571

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 5 - CFML and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 5

Table of Contents