Author: Yihuey | Posted on: 11/16/2009 3:11:26 PM | Views : 464

I have a password strength requirement to validate. I have been trying regular expression with no luck. Any help is appreciated.
Passwords must meet these requirements:
Passwords must be at least 8 characters.
Passwords must contain a combination of at least three of the following:
1. Uppercase character (A-Z)
2. Lowercase character (a-z)
3. Number (0-9)
4. Special Character (e.g. !,@,#). Do not use ?, % or *
The regular express I came up with is:
^(.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*)|(.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[!@#$]).*)|(.*(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$]).*)|(.*(?=.{8,})(?=.*[A-Z])(?=.*\d)(?=.*[!@#$]).*)$
The problem with this regular express is if I enter a password with ?, % or *, it still validate it to true. How do I make sure the users do not enter any of the characters ?, % or *?
Than ...

Go to the complete details ...