As long as you are willing to concede that an underscore '_' is alphanumeric, you can use this:
\w is shorthand for the character class [A-Za-z0-9_] and \W is the inverse of that set, i.e. [^\w].$user_name =~ s/\W//g;
In reply to Re: How do I keep anything other than alphanumeric out of a variable?
by turnstep
in thread How do I keep anything other than alphanumeric out of a variable?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |