The regex for a number, letter or dash is: [-0-9a-z]
(to include a literal dash in your character class, specify it as the first character; thereafter it's considered a range operator).
Try:
$('.my-input').keyup(function() {this.value = this.value.toLowerCase().replace(/[^-0-9a-z]/g,''); });