字母+數字。最少6位的正則表達式Pattern p = Pattern.compile("(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,}"); Matcher m = p.matcher(passwd);