The java regular password contains at least 3 of the 4 types of numbers, lowercase letters, uppercase letters, and special symbols

   //密码应包括数字、小写字母、大写字母、特殊符号4类中至少3类;
   public boolean checkPwd(String pwd)
   {
      String PW_PATTERN = "^(?![a-zA-Z]+$)(?![a-z\\d]+$)(?![a-z!@#\\$%]+$)(?![A-Z\\d]+$)(?![A-Z!@#\\$%]+$)(?![\\d!@#\\$%]+$)[a-zA-Z\\d!@#\\$%]+$";
      
      return pwd.matches(PW_PATTERN);
   }

 

Guess you like

Origin blog.csdn.net/dkm123456/article/details/114398808