I have an input which I am binding to keyup()
On each keyup, I want it to:
Regex makes my head explode, any help?
$('.my-input').keyup(function() {
this.value = this.value.replace(/[^0-9a-z-]/g,/[0-9a-z-]/g);
});
this.value = this.value.toLowerCase().replace(/[^0-9a-z-]/g,"");
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