Created
July 31, 2019 10:48
-
-
Save tmaxxdd/f5556c770bb5d8256a95b2afbcde4cb0 to your computer and use it in GitHub Desktop.
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
private boolean isPasswordValid(CharSequence pass) { | |
/* | |
^ # start-of-string | |
(?=.*[0-9]) # a digit must occur at least once | |
(?=.*[a-z]) # a lower case letter must occur at least once | |
(?=.*[A-Z]) # an upper case letter must occur at least once | |
(?=.*[@#$%^&+=]) # a special character must occur at least once | |
.{8,} # anything, at least eight places though | |
$ # end-of-string | |
*/ | |
return pass.toString().matches("^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).{8,}$"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment