For the password, you could try:
if(!(password.length() >= 6) || !password.matches(".*?[A-Z].*") || !password.matches(".*?[a-z].*") || !password.matches(".*?[0-9].*") || !password.matches(".*?[\\W\\-_].*")) {
System.out.println("Password Invalid");
}
Explanation -
.*? - indicates that the regex may start with zero-or-more characters, before being followed by<br>
[A-Z] - a Capital Letter from 'A' to 'Z'
[a-z] - a lowercase letter from 'a' to 'z'
[0-9] - a digit from 0-9
[\\W\\-_] - a non-word character (not letter, digit or dash), a dash, or underscore
.* - indicates that after the special character (or whatever the requirement for that condition is), there may be zero-or-more characters.
This approach may seem a bit lengthy, but is certainly easier to read and understand.