-
-
Save RyanABailey/97b261f8c4b5dda103bd to your computer and use it in GitHub Desktop.
regex password
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
var password = "Mypassword01"; | |
var regexString = "^((?=.{8,}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*|(?=.{8,}$)(?=.*\d)(?=.*[a-zA-Z])(?=.*[!\u0022#$%&'()*+,./:;⇔?@[\]\^_`{|}~-]).*)"; | |
var regexx = new RegExp(regexString); | |
if (!regexx.test(password)) { | |
// password did not match regex | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment