posted 16 years ago
I'm struggling to figure out a single regular expression which will match a password having the following rules:
o Passwords must be 6-16 characters.
o Allowed characters are alphanumeric, hyphen(-) and underscore(_)
o They must contain both numbers and letters
Currently the code uses 3 regular expressions to accomplish the goal:
And then to check the password:
What is the easiest way to construct a single regular expression combining these 3?