Last active
June 1, 2017 13:24
-
-
Save codeasashu/2e8af1e2b48c1f027297094926faed52 to your computer and use it in GitHub Desktop.
Some regex collection
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
| ##Username regex | |
| ^[a-zA-Z0-9]+$ | |
| This only allows alphanumeric | |
| ##Password regex | |
| ^(?=.*?[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 8 in length .{8,} (with the anchors) | |
| ##Address Regex | |
| ^\d+\s[A-z]+\s[A-z]+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment