<CFSET subExprs=REFind("([A-Za-z]+)[ ]+\1",
"There is is a cat in in the kitchen",1,"TRUE")>
<CFSET posarray = subExprs.pos>
<CFSET lenarray=subExprs.len>
After these statements, posarray[1]=7, lenarray[1]=6, posarray[2]=7, and lenarray[2]=2.
Note that posarray[1] and lenarray[1] refer to the entire matched expression ("is is"), while posarray[2] and lenarray[2] refer to the first parenthesized sub-expression. This is always the case, because the complete matched expression is returned in the first element and the parenthesized elements are returned sequentially from indices 2 onwards. Posarray[1] and lenarray[1] are both 0 if there are no matches.
|