Skip to content

Commit e8e4c15

Browse files
committed
add solution Collections task 3204
1 parent 5149d3a commit e8e4c15

File tree

1 file changed

+3
-1
lines changed
  • 4.JavaCollections/src/com/javarush/task/task32/task3204

1 file changed

+3
-1
lines changed

4.JavaCollections/src/com/javarush/task/task32/task3204/Solution.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public static ByteArrayOutputStream getPassword() {
2121

2222
char[] password = new char[8];
2323
String string = "";
24-
while (!string.matches(".*\\d.*") || !string.matches(".*[a-z].*") || !string.matches(".*[A-Z].*")) {
24+
while (!string.matches(".*\\d.*") ||
25+
!string.matches(".*\\p{Ll}.*") ||
26+
!string.matches(".*\\p{Lu}.*")) {
2527
for (int i = 0; i < password.length; i++) {
2628
password[i] = template.charAt(new Random().nextInt(template.length()));
2729
}

0 commit comments

Comments
 (0)