Commit 1577217b by 吴迪

【新增】修改bug

parent 14990121
......@@ -13,18 +13,18 @@ public class PasswordValidator {
public static final String pattern="^(?![\\d]+$)(?![a-z]+$)(?![A-Z]+$)(?![@$!%*#?&]+$)[\\da-zA-z@$!%*#?&]{8,20}$";
//public static boolean isValidPassword(String password) {
// if(password.matches(PASSWORD_PATTERN)||password.matches(PASSWORD_PATTERN_2)||password.matches(PASSWORD_PATTERN_3)) {
// return true;
// } else{
// return false;
// }
//}
public static boolean isValidPassword(String password) {
return password.matches(pattern);
if(password.matches(PASSWORD_PATTERN)||password.matches(PASSWORD_PATTERN_2)||password.matches(PASSWORD_PATTERN_3)) {
return true;
} else{
return false;
}
}
//public static boolean isValidPassword(String password) {
// return password.matches(pattern);
//}
public static void main(String[] args) {
String pattern="^(?![\\d]+$)(?![a-z]+$)(?![A-Z]+$)(?![@$!%*#?&]+$)[\\da-zA-z@$!%*#?&]{8,20}$";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment