Solved

Find function

Posted on 2014-11-04
3
93 Views
Last Modified: 2014-11-05
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
0
Comment
Question by:AlexPonnath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 40422866
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
0
 

Author Comment

by:AlexPonnath
ID: 40422969
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..
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
ID: 40423044
Mine obviously wasn't a plug & play solution. Just showing the concept.

In any case, should work just fine.

btw in most cases you don't need #'s within CF tags


<CFSET CKRSTART refindnocase("\bCKR\b", form.text1,Curcuit))>
0

Featured Post

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question