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 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 "this-page"
>
> cumbersome, any better ways of doing this, maybe one line of code and not
> two, or a function about this does this?
>
> Thanks
>
> Glyn
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:327443
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4