Yes, indeed.  You want something like this:

keyword = "star";
myString = "The dog sniffed at the starfish and growled";
regEx = "\b" & keyword & "\b";
if (reFindNoCase(regEx, myString)) {
     writeOutput("found it");
} else {
     writeOutput("did not find it");
}

On 8/17/2011 5:20 PM, Nathan C. Smith wrote:
> If I want to scan a string to match only a whole word should I be looking at 
> regular expressions?  I want to scan a string like
>
> "The dog sniffed at the starfish and growled"
>
> And if I scan for "star" not match "starfish".
>
> Are regular expressions the most effective way to do that?
>
> Thank you.
>
> -Nate
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346816
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to