+ 2

I am unable to solve password validation.can anyone help me out?

I did this ,tried it out very much 1 out of 13th case is going wrong so please help me out to match this.. https://code.sololearn.com/c4Yg0KXOqXvx/?ref=app

18th May 2020, 12:25 PM
Nikhil Maroju
Nikhil Maroju - avatar
3 odpowiedzi
+ 3
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner input = new Scanner (System.in); String password = input.nextLine(); if ((password.length() >= 7) && ((password.matches("((.*[a-zA-Z]{1,}.*){2,})")) && (password.matches("((.*\\d{1,}.*){2,})"))) && ((password.matches("((.*[!@#$%&*]{1,}.*){2,})")))){ System.out.println("Strong"); }else{ System.out.println("Weak"); } } }
20th May 2020, 9:23 AM
Shahghasi Adil
Shahghasi Adil - avatar
+ 1
Thank you S Adil 🇦🇫 for your answer
20th May 2020, 12:18 PM
Nikhil Maroju
Nikhil Maroju - avatar
0
Nikhil Maroju just mark as correct my answer😘
20th May 2020, 12:21 PM
Shahghasi Adil
Shahghasi Adil - avatar