|
-
Aug 22nd, 2012, 10:02 AM
#1
Thread Starter
New Member
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.
Last edited by mjclark91; Aug 22nd, 2012 at 12:21 PM.
-
Aug 22nd, 2012, 11:00 AM
#2
Re: Javascript Regular Expression
Moved to the JavaScript forum
-
Aug 23rd, 2012, 08:55 AM
#3
Thread Starter
New Member
Re: Javascript Regular Expression
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|