Browse Source

提交判定字符

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

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

@@ -5,8 +5,8 @@ import java.util.regex.Pattern;
 public class PwdDefind {
 
     public static boolean vertify(String pwd){
-        //密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位
-        String regex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&+—_=<>.,])(?=\\S+$).{8,20}$";
+        //密码至少包含:大小写英文字母、数字,密码长度大于8位,小于20位
+        String regex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,20}$";
         return Pattern.matches(regex, pwd);
     }
 }