I'm trying to check if a password contain at least one lower case letter, one upper case letter, one digit and one special character.
i'm trying this:
if(!password.matches("(?=.*d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])")){
username = "Error";
}
but give me an error saying: invalid escape sequence.
Someone can help me to solve the problem and can confirm that is a correct pattern?
Thanks, whit \d don't do error but it don't match with a string like Paul%88 why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…