reReplace(string, "[^A-Za-z0-9]", "_", "ALL") on 'some phrase' returns 'some_phrase' as expected.
reReplace(string, "[[:punct:]]|[[:space:]]", "_" "ALL") on 'some phrase' returns '_some_phrase_' which was not expected. The string 'some phrase' really is just that without any extra spaces. Either way, the first method works just fine and is probably safer. -----Original Message----- From: Joshua Miller [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 12:30 PM To: CF-Talk Subject: RE: Regular Expression Help Did you TRIM the variable first? That may help ... Perhaps there's whitespace surrounding the text. Try: ReReplaceNoCase(trim(variable),"[^A-Za-z0-9]","_","ALL") Joshua Miller Head Programmer / IT Manager Garrison Enterprises Inc. www.garrisonenterprises.net [EMAIL PROTECTED] (704) 569-9044 ext. 254 ************************************************************************ ************* Any views expressed in this message are those of the individual sender, except where the sender states them to be the views of Garrison Enterprises Inc. This e-mail is intended only for the individual or entity to which it is addressed and contains information that is private and confidential. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying is strictly prohibited. If you have received this e-mail in error please delete it immediately and advise us by return e-mail to [EMAIL PROTECTED] ************************************************************************ ************* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq 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