From 83af3a6066a654e4840f83b41adc071926babc05 Mon Sep 17 00:00:00 2001 From: pbg2h21ama Date: Tue, 17 Jan 2023 16:02:29 +0100 Subject: [PATCH] =?UTF-8?q?Regex=20in=20validateData=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data.java b/src/Data.java index 8c5a40f..3ba410c 100644 --- a/src/Data.java +++ b/src/Data.java @@ -242,7 +242,7 @@ public class Data { boolean passwordValid = false; Pattern phoneNumberPattern = Pattern.compile("[0-9]*"); - Pattern passwordPattern = Pattern.compile("^[^a-zA-Z0-9].*[0-9]$"); + Pattern passwordPattern = Pattern.compile("^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$"); Scanner reader = new Scanner(System.in);