I'd use [[:punct:] ] as the class if you only need to check spaces -- if you need vertical tabs, carriage returns, tabs, etc. use [[:punct:][:space:]] which should give you something like newstring = rereplace(string, "[[:punct:][:space:]]", "_", "all");
Of course, it might be easier (as Rob suggested) to think about what characters you want to allow instead of disallow: newstring = rereplace(string, "[^a-zA-Z0-9_]", "_", "all"); would only keep letters, numbers, and underscores. As always, the plug for the RegEx list: http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21 Read, Post to, or Join the list here for all your RegEx needs. :-) --Ben Doom Programmer & General Lackey Moonbow Software : -----Original Message----- : From: Joshua Miller [mailto:[EMAIL PROTECTED]] : Sent: Friday, December 06, 2002 12:43 PM : To: CF-Talk : Subject: RE: Regular Expression Help : : : Oh, forgot the space .... use "[[:punct:]]||[[:space:]]" as the RegEX : : 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] : ************************************************************************ : ************* : : : -----Original Message----- : From: Jeff D. Chastain [mailto:[EMAIL PROTECTED]] : Sent: Friday, December 06, 2002 12:31 PM : To: CF-Talk : Subject: Regular Expression Help : : : I am trying to use a regular expression to change all possible special : characters in a string to underscores because I am trying to use the : string as a variable name. : : Regular expressions are not my specialty and I am running into problems : using some characters in my reReplace function. : : Could somebody offer some suggestions on making this work? : : I am needing to replace !@#$%^&*()-+={[}]|\:;"'<,>.?/ plus a blank : space, all with the _ character. : : Thanks : -- Jeff : : : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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 Get the mailserver that powers this list at http://www.coolfusion.com

