Hey all. I'm having some trouble with a regular expression.
I'm trying to allow lbackspaces, lowercase letters, numbers, and dashes.
Here it is:I'm testing it as such:Code:var AllowRegex = /^[\ba-z0-9-]$/;For some reason it's not working. It only functions when I use it like this (which isn't the way I want it) : var AllowRegex = /^[\ba-zA-Z0-9-]$/;Code:AllowRegex.test(character)
Can someone help me get to where I need to be?
Thanks in advance!
Mike.




Reply With Quote