MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference - page 520
496
CFML Language Reference
In order to create this structure you can use a CFSET statement, for
example:
<CFSET st = REFindNoCase("[[:alpha:]]+",testString,1,"TRUE")>
The number of elements in each array: #ArrayLen(st.pos)#.
The number of elements in the pos and len arrays will always be one
if you do not use parentheses to denote subexpressions in the regular
expression.
The value of st.pos[1] is:
The value of st.len[1] is:
Substring is [#Mid(testString,st.pos[1],st.len[1])#]
However, if you use parentheses to denote subexpressions in the
regular expression, you will find that the first element contains the
position and length of the first instance of the whole expression. The
position and length of the first instance of each subexpression within
will be included in additional array
elements.
For example:
<CFSET st1 = REFindNoCase("([[:alpha:]]+)[
]+(\1)",testString,1,"TRUE")>
The number of elements in each array is
First whole expression match; position is
#st1.pos[1]#; length is #st1.len[1]#;
whole expression match is
[#Mid(testString,st1.pos[1],st1.len[1])#]
Subsequent elements of the arrays provide the position and length of
the first instance of each parenthesized subexpression therein.
Substring is [#Mid(testString,st1.pos[i],st1.len[i])#]