I am trying to see whether a string contains at least a digit or a lowercase or an uppercase.
I have written something like this:
int combinations = 0;
string pass = "!!!AAabas1";
if (pass.matches("[0-9]")) {
combinations = combinations + 10;
}
if (pass.matches("[a-z]")) {
combinations =combinations + 26;
}
if (pass.matches("[A-Z]")) {
combinations =combinations + 26;
}
However I don't understand why I cannot get combinations to go to 36. They just remain at 0. What am I doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…