Thanks to those who have provided some guidance (on and off list)! Note to those still using ReFIND (and its kin)... REMatch removes the need to do any substring manipulations -- it throws the results into an array as is!
Here is the solution <cfset search_string = """Healthy Eating"" kids schools ""Ontario Canada"""> <cfset my_reg_ex = "(?:""([^""]+)"")|([^ ]+) "> <cfset my_array = REMatch (my_reg_ex, search_string)> <cfdump var="#my_array#"> Cheers, Matts > Hi All, > > Have NOT ventured into regular expressions much at all. Now I have the > need for one, and wonder if anyone has one made for this scenario. > > Search engine, want user to be able to enter multiple words, also > phrases. Want my SQL to loop over the phrases and words with an AND... > (the SQL I can handle!). > > For example, user types in "Healthy Eating" kids schools "Ontario > Canada" > > ReMatch would produce an array of > Healthy Eating > kids > schools > Ontario Canada > > my SQL search would loop over these 4 words/phrases. > > I've found a PHP regex that does this exact thing.. but the syntax > must be different in CF and PHP for the regex part. > > preg_match_all('#(?:"([^"]+)")|([^ ]+)#', trim($keywords), > $match_words); > > Anyone have a CF equivalent? > > Thanks a bunch, > > 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:313394 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4