A quick follow up to this, and some improved code (thanks to those on the RegEx 
list).

<cfsavecontent variable = "my_reg_ex">(?:"([^"]+)")|([^ ]+)</cfsavecontent>

<!--- NOTE a trailing whitespace character has been removed, and for ease of 
readability, cfsavecontent has been used to remove need to escape the quotes 
--->

<cfset my_search_terms_array = REMatch (my_reg_ex, FORM.search_terms)>

<!--- if person enters only one word, then no regex matches (since no spaces), 
so
        put the single search term into the first item in the array --->

<cfif ArrayIsEmpty(my_search_terms_array) AND FORM.search_terms NEQ "">
        <cfset my_search_terms_array[1] = FORM.search_terms>
</cfif>


Cheers,

Matts 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315169
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to