Created
January 14, 2019 16:18
-
-
Save lffsantos/f6ace91250aab15351cc289dcf5943d5 to your computer and use it in GitHub Desktop.
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
validate_password(password) { | |
let minMaxLength = /^[\s\S]{8,32}$/, | |
upper = /[A-Z]/, | |
lower = /[a-z]/, | |
number = /[0-9]/, | |
special = /[ !"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/; | |
if (minMaxLength.test(password) && | |
upper.test(password) && | |
lower.test(password) && | |
number.test(password) && | |
special.test(password) | |
) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment