Created
November 23, 2016 07:26
-
-
Save Kjaer/959193f73402b3ae7fa782cd08f823a0 to your computer and use it in GitHub Desktop.
Password RuleSet
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
This is the javascript regular expression to check password meet the reqirements. | |
Here it is : | |
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$-/ | :-? | {-~ | ! | @ | # | " | ^ | _ |` | \[ | \]])[a-zA-Z0-9$-/:-?{-~!@#"^_`\[\]]{8,16}/g | |
(?=.*[a-z]) means should include lowercase letter | |
(?=.*[A-Z]) means should include uppercase letter | |
(?=.*[0-9]) means should include number | |
(?=.*[$-/ | :-? | {-~ | ! | @ | # | " | ^ | _ |` | \[ | \]]) means should include symbol | |
[a-zA-Z0-9$-/:-?{-~!@#"^_`\[\]] can accept these given charset class and chars. | |
Expression can be tested over there: | |
- http://www.regextester.com/?fam=96302 | |
Happy coding. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment