I have an input which I am binding to keyup()
On each keyup, I want it to:
Good question.. you're almost there!
$('.my-input').keyup(function() { this.value = this.value.replace(/[^A-Za-z0-9-]/g,"").toLowerCase();
Regex is not the right tool for lowercasing, use the built-in function. Your regex was good, but the replace function takes one regex and the replacement is a string, not a regex*.
(*replacement strings have some minor magic, but not enough for lowercasing)