Thanks in advance.
I would like a regular expression that removes anything that is NOT alpha numeric and a hyphen. So allowed are A-Z 0-9 and -.
Also, how could I apply that to a string in Javascript?
Thanks again.
var str = 'a23a-asd!@#$';
str.replace(/[^-a-z0-9]/ig,'');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With