Loading

密码强度校验


/**
 * 密码强度校验
 * @param psw
 * @return
 */
public static boolean checkPwdFormat(String psw) {
    // 密码由8~16位数字大小写字母组成,区分大小写,三者必须混用
    String regex = "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,16}$";
    Pattern p = Pattern.compile(regex);
    Matcher m = p.matcher(psw);
    return m.matches();

}

 

 
posted @ 2021-07-02 10:53  Robinzhao  阅读(112)  评论(0)    收藏  举报