Reputation: 1807
Simple question,
I have jquery function alphanumers
var alphanumers = /^[a-zA-Z0-9- ]*$/;
it will not allowed all symbols.
But now I want the space
including to be not allowed.
Any idea?
Upvotes: 1
Views: 82
Reputation:
To also disallow space, change it to:
var alphanumers = /^[a-zA-Z0-9-]*$/;
This will allow any character A to Z in either upper- or lower-case, numbers 0 to 9 and the dash character.
Upvotes: 1