Password Verification requirements:
1) Password control can only enter letters, numbers, special symbols ([email protected]#$%^&* () _+[]{}|\;: ' ",./<>?)
2) length 6-16 digits, must include 2 kinds of letters, numbers, special symbols
3) password cannot contain user name information
Determine if the password contains a number: contains return 1, does not contain return 0
int i = newpwd.matches (". *\\d+.*")? 1:0;
Determine if the password contains letters: contains return 1, does not contain return 0
Int j = newpwd.matches (". *[a-za-z]+.*")? 1:0;
Determine if the password contains special symbols (email protected]#$%^&* () _+|<>,.? /:;‘ []{}\): contains return 1, does not contain return 0
int k = newpwd.matches (". *[[email protected]#$%^&* () _+|<>,.? /:;‘ \\[\\]{}\"]+.*") ? 1:0;
Determine if the password length is 6-16 bits
int L = newpwd.length ();
Determine if the password contains a user name
Boolean contains = Newpwd.contains (userId);
If (i + j + K < 2 | | L < 6 | | L > | | | Contains) {
return Password error;
}
Java Login Password Validation