Tuesday, 10 September 2013

Find Multiple Occurrences in String using REFind

Find Multiple Occurrences in String using REFind

I'm trying to get ColdFusion's REFindNoCase function to return multiple
instances of a matching string but can't seem to get it to work:
<cfset string2test="cfid skldfjskdl cfid sdlkfjslfjs cftoken dslkfjdslfjks
cftoken">
<cfset CookieCheck = REFindNoCase( 'CFTOKEN', string2test, 1, true)>
<cfif arrayLen( CookieCheck['LEN'] ) gt 1>
MULTIPLE CFTOKEN!
</cfif>
Is there a regular expression magic syntax I need to use to make it search
for more than 1?

No comments:

Post a Comment