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( Form.PageName , '\W+' , '-' , 'All' )


\W in that regex stands for non-word-character, equivalent in CF to 
[^a-zA-Z0-9_] 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:327496
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to