I trying validate password and the conditions are
1- A-a
2- 0- 9
3- Special characters
The first and second conditions work fine with this expression
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,16})$
But i dont know implement the third condition.
My Method
public static boolean PasswordStrong(String pass) {
String expresion = "(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,16})$";
Pattern patron = Pattern.compile(expresion);
Matcher m = patron.matcher(pass);
if (m.find())
return true;
return false;
}