Created
April 23, 2012 05:50
-
-
Save rezigned/2469020 to your computer and use it in GitHub Desktop.
Regex for password validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{7,20}) | |
( # Start of group | |
(?=.*\d) # must contains one digit from 0-9 | |
(?=.*[a-z]) # must contains one lowercase characters | |
(?=.*[A-Z]) # must contains one uppercase characters | |
(?=.*[@#$%]) # must contains one special symbols in the list "@#$%" | |
. # match anything with previous condition checking | |
{7,20} # length at least 7 characters and maximum of 20 | |
) | |
# Refs: http://www.mkyong.com/regular-expressions/how-to-validate-password-with-regular-expression/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment