/**
* 大写字母、小写字母、数字、特殊字符,至少有2个组合
* @param str
* @return
*/
public static boolean checkpwd(String str){
Integer isDigit = 0;//数字字符
Integer isUpperCase = 0;//大写字符
Integer isLowerCase = 0;//小写字符
Integer count = 0;//计数器
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (Character.isDigit(c)){
isDigit++;
} else if (Character.isUpperCase(c)){
isUpperCase++;
} else if (Character.isLowerCase(c)){
isLowerCase++;
}
}
boolean b3 = Validator.isSpecialChar(str);
if (isDigit>0) {
count++;
}
if (isUpperCase>0){
count++;
}
if (isLowerCase>0){
count++;
}
if (b3){
count++;
}
if (count>=2){
return true;
} else {
return false;
}
}