Jacob L
asked on
Regex for validating password requirements
I need some regex help. I am currently using the following regex "^(?=.*[a-z])(?=.*[A-Z])(? =.*[^a-zA- Z])(?=.*[^ a-zA-Z])\S {8,20}$" (without the quotes) to validate a password that would require an upper, lower and non-alpha character. I need regex to meet the following criteria:
The password contains characters from three of the following categories:
Uppercase letters
Lowercase letters
Base 10 digits (0 through 9)
Non-alphanumeric characters (special characters): (~!@#$%^&*_-+=`|\(){}[]:;" '<>,.?/) Currency symbols such as the Euro or British Pound are not counted as special characters for this policy setting.
Any Unicode character that is categorized as an alphabetic character but is not uppercase or lowercase. This includes Unicode characters from Asian languages.
The password contains characters from three of the following categories:
Uppercase letters
Lowercase letters
Base 10 digits (0 through 9)
Non-alphanumeric characters (special characters): (~!@#$%^&*_-+=`|\(){}[]:;"
Any Unicode character that is categorized as an alphabetic character but is not uppercase or lowercase. This includes Unicode characters from Asian languages.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Apologies I had a baby and been off for a couple weeks. The solutions helped. Thank you.
ASKER
So if I wanted to test without the unicode it would look something like this?
^((?=.*[A-Z])(?=.*[a-z])(?