public boolean isPassword(String password){
  if (TextUtils.isEmpty(password)) {
    mPassword.error("Password cannot be null !");
    return false;
  }
  String pattern="(?!^(\\d+|[a-zA-Z]+|[!%&@#$^_.]+)$)^[\\w!%&@#$^_.]{6,18}+$";
  if (password.matches(pattern)) {
    return true;
  }
 else {
    mPassword.error("Illegal Password Input !");
    return false;
  }
}

public boolean isPassword ( String password ) { if ( TextUtils . isEmpty ( password ) ) { mPassword . error ( "Password cannot be null !" ) ; return false ; } String pattern = "(?!^(\\d+|[a-zA-Z]+|[!%&@#$^_.]+)$)^[\\w!%&@#$^_.]{6,18}+$" ; if ( password . matches ( pattern ) ) { return true ; } else { mPassword . error ( "Illegal Password Input !" ) ; return false ; } }
required 6 - 18 words , contain upper and lower case letters , numbers or a combination of at least two special symbols
