RegExp - Replace special characters in a string
Submitted by Thursday, 15 January, 2009 - 20:00
on
I am writing a macro that will take highlighted text, convert any non alpha numeric characters to underscores, and then open a .chm file to the topic named by the resulting string.
I can make everything except the regular expression part of that work. I only yesterday started playing with regular expressions, and I'm not sure how to do this, and google was not much help.
Here is what I need....
I have,
SomeVariable= "?This!String@1#2&3."
I need to make
SomeVariable= "_this_string_1_2_3_"
Here is the set I want to replace [!@#$%^&*()<>{}[]?~`|\/]
Is this an easy thing to achieve?
Thanks for the help.