
regex to escape special characters
Quote:
> is there a regular expression to escape all non alphanumeric characters in a
> string?
See the description for \Q in the "Quote and Quote-like Operators"
section of:
perldoc perlop
and also:
perldoc -f quotemeta
Or, just do it all yourself (untested):
s/(\W)/\\$1/g;
--
Tad McClellan SGML consulting
Fort Worth, Texas