Re: REReplace Statment Help

2009-10-22 Thread Peter Boughton
This will replace everything that is not alphanumeric with a dash: ProductPageName = rereplace( Form.PageName , '\W' , '-' , 'All' ) However, the above will change this that to this---that, if you would prefer a single dash in situations like this, you can simply do this: ProductPageName =

REReplace Statment Help

2009-10-21 Thread Glyn Jackson
I am just going over some old code, I found the following... productPageName = Replace(#FORM.pageName#, ,-,All); productPageName = REReplace(#productPageName#,[.*+?^${}()|[\]/\\],,All); its seems like its create a page name but removed spaces and special characters i.e. this page! becomes

Re: REReplace Statment Help

2009-10-21 Thread Scott Stroz
There are 2 separate thing being done with that code. 1. Its replacing spaces with a - 2. Its removing a bunch of 'special' characters. There really is no way to do this in one live of code. However, if this is something you woudl need to use in more than one place, you can easily put these

Re: REReplace Statment Help

2009-10-21 Thread Eric Cobb
If you want it in one line, just combine them: productPageName = Replace(REReplace(FORM.pageName,[.*+?^${}()|[\]/\\],,All), ,-,All); BTW, you don't the the #'s inside of a function unless the variable is in quotes. Thanks, Eric Cobb http://www.cfgears.com Glyn Jackson wrote: I am just

Re: REReplace Statment Help

2009-10-21 Thread Glyn Jackson
Makes sense, thanks you. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327452

Re: REReplace Statment Help

2009-10-21 Thread Mahcsig
also, if you are replace all non alpha-numeric characters you can do this:reReplace(arguments.txt, '[^[:alnum:].]', '-', 'all'); ~Mahcsig On Wed, Oct 21, 2009 at 8:57 AM, Glyn Jackson glyn.jack...@newebia.co.ukwrote: Makes sense, thanks you.