Javascript Regular Expression
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:
Code:
var AllowRegex = /^[\ba-z0-9-]$/;
I'm testing it as such:
Code:
AllowRegex.test(character)
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-]$/;
Can someone help me get to where I need to be?
Thanks in advance!
Mike.
Re: Javascript Regular Expression
Moved to the JavaScript forum
Re: Javascript Regular Expression