1//Password validation example
2public static Boolean validPassword(String password) throws IllegalArgumentException {
3 if (!password.matches("\\w{6,}"))/*Or '(password.matches("\\w{6,}") == false)'*/ {
4 throw new IllegalArgumentException("Password must be at least 6 characters long.");
5
6 //'("\\w{int}")' => Must be int characters long.
7 //'("\\w{int,}")' => Must be AT LEAST int characters long and can be longer.
8 //'("\\w{int1,int2}")' => Must be BETWEEN int1 AND int2 characters long.
9
10 }
11 return true;
12}