You could also dotr/-a-zA-Z0-9//cd;
If you wanted a regexp solution. Howevers/[^-a-z0-9]//ig;
(which is what I think you think you're looking for) will not do what you want, because \w includes _.s/[^-\w]//g;
In reply to Re: Regex question : How to match \w and just the dash
by Eimi Metamorphoumai
in thread Regex question : How to match \w and just the dash
by hmbscully
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |