/** * 密码强度校验 * @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(); }