Link to home
Start Free TrialLog in
Avatar of AlexPonnath
AlexPonnathFlag for United States of America

asked on

Find function

I have a doc which I am searching which has both the string "CKR" and "CKR1", is there a way to only search for CKR and don't have it find a match via the CKR1 as well ? If not I might need to try to search for "CKR " since that would eliminate the CKR1 matches

Thanks
Avatar of SidFishes
SidFishes
Flag of Canada image

You can use REFindNoCase and a word boundary regex

<cfset myCriteria = "ckr">

<cfset strToSearch = "ckr1 some stuff">

<cfif refindnocase("\b#myCriteria #\b", strToSearch )>
Found
<cfelse>
Not Found
</cfif>

Try with both
ckr some stuff
ckr1 some stuff
Avatar of AlexPonnath

ASKER

that might work in some case but I am using something like this

<CFSET CKRSTART = #find("CKR ", form.text1,Curcuit)#>
<CFSET CKR1START = #find("CKR1 ", form.text1,Curcuit)#>

not sure if that will work in that case..
ASKER CERTIFIED SOLUTION
Avatar of SidFishes
SidFishes
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial