Bobby Hartsfield wrote: > My brother's name is Justin William Eugene Mckinney III. That > might throw you for a loop. It will really throw you for a > loop when it is "Justin William Eugene Mckinney III PHD" > Or > "Dr. Justin William Eugene Mckinney III"
Hi Bobby Yep, I considered this type of thing and you are right, so for better or worse on the search box view I am advising them to enter first and last names only. And before the search is executed I am also doing: <cfset indexOfOccurrence = REFind("[a-z]+ ", searchstring) /> And if it is greater than 1 I shoot them back with an error message telling them they entered too many names. I'm also checking for numbers and other characters. > Simply taking listfirst() and listlast() delimited by a space > won't always give you the result you want... but when it IS a > good idea... you just do... > > <cfset firstname = listfirst(name, " ") /> <cfset lastname = > listlast(name, " ") /> This is what I'm going with since it is simple and effective enough for my requirements. Thanks! then Jide Aliu wrote > From what you're saying, you probably might not need Regex. > How about GetToken? > > <cfset SearchField = "Joe Bloggs"> > > <cfset var1 = GetToken(trim(SearchField), 1, " ")> <cfset > var2 = GetToken(trim(SearchField), 2, " ")> > > Am I barking up the wrong tree? Jide, no I don't think you are, but when I try this it returns a full set of results in the database. It could be the way my search query logic is ordered, since when I output var1 and var2, they appear to be correct. However, I had some success with listfind and also with Bobby's suggestion above (which is what I'm using), so I didn't delve into it too much. I'm still getting some delay on the HOF mail delivery, so thanks to all who replied. Mark -- This message has been scanned for viruses and dangerous content by ISPNZ's automated virus detection system, and is believed to be clean. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284691 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4