Browse Source

新增密码判断特殊符号_

raojiaolong@163.com 2 years ago
parent
commit
c0be699640
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])(?=.*[!@#$%^&+=<>.,])(?=\\S+$).{8,20}$";
+        String regex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&+—_=<>.,])(?=\\S+$).{8,20}$";
         return Pattern.matches(regex, pwd);
         return Pattern.matches(regex, pwd);
     }
     }
 }
 }