Browse Source

密码判定

溪鸭夏 2 years ago
parent
commit
11fd688d55
1 changed files with 1 additions and 1 deletions
  1. 1 1
      mhotel/src/com/happy/Until/PwdDefind.java

+ 1 - 1
mhotel/src/com/happy/Until/PwdDefind.java

@@ -6,7 +6,7 @@ public class PwdDefind {
 
 
     public static boolean vertify(String pwd){
     public static boolean vertify(String pwd){
         //密码至少包含:大小写英文字母、数字,密码长度大于8位,小于20位
         //密码至少包含:大小写英文字母、数字,密码长度大于8位,小于20位
-        String regex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,20}$";
+        String regex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,20}$";
         return Pattern.matches(regex, pwd);
         return Pattern.matches(regex, pwd);
     }
     }
 }
 }