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 =
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
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
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
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
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.
6 matches
Mail list logo