This doesn't parse by token, but you could replace the search for % with
a space. I use this to allow for dynamic emails, i.e. user types in the
email message with actual db fields designated by %.
<CFSET found=#find("%",tmp)#>
<cfloop condition="found gt 0">
<CFIF #left(tmp,1)# is "%">
<CFELSE>
<CFSET contents="#contents##left(tmp,(find("%",tmp)
-1))#">
</CFIF>
<CFSET tmp="#mid(tmp,(find("%",tmp)+1),len(tmp))#">
<CFSET foundvariable="Sql." & "#left(tmp,(find("%",tmp) -1))#">
<CFSET contents="#contents##evaluate(foundvariable)#">
<CFSET tmp="#mid(tmp,find("%",tmp)+1,len(tmp))#">
<CFSET found=#find("%",tmp)#>
</cfloop>
<CFSET contents="#contents##tmp#">
-----Original Message-----
From: Kris Pilles [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 7:37 AM
To: CF-Talk
Subject: Search string pasing?
Does anyone have an example sof parsing strings with CF?
I need to "enhance"our search engine so that we can control the search
cresults and in order to do this, I need to break the search string down
into words so I can search for keyword matches by the entire string then
by each word...
Any ideas..
Thanks KP
Kris Pilles
Website Manager
Western Suffolk BOCES
507 Deer Park Rd., Building C
Phone: 631-549-4900 x 267
E-mail: [EMAIL PROTECTED]
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists