Created
June 30, 2019 18:38
-
-
Save g-rohit/59009e6bd21a33deb2ed36d49332d03b to your computer and use it in GitHub Desktop.
Reg ex for password
This file contains hidden or 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
You may use this regex with multiple lookahead assertions (conditions): | |
^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$ | |
This regex will enforce these rules: | |
At least one upper case English letter, (?=.*?[A-Z]) | |
At least one lower case English letter, (?=.*?[a-z]) | |
At least one digit, (?=.*?[0-9]) | |
At least one special character, (?=.*?[#?!@$%^&*-]) | |
Minimum eight in length .{8,} (with the anchors) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment