public static boolean isAllPresent(String str)
{
String regex = "(?=.*[A-Z])(?=.*\\d)(?=.*[a-z])(?=.*\\d)(?=.*[.#@!~%^&*])[A-Z\\da-z\\d.#@!~%^&*]{8,16}";
Pattern p = Pattern.compile(regex);
if (str == null) {
System.out.println("No");
return false;
}
Matcher m = p.matcher(str);
if (m.matches()){
System.out.println(str+"======Yes");
return true;
}else{
System.out.println(str+"======No");
return false;
}
}
网友评论