+ 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
3 Answers
+ 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");
}
}
}
+ 1
Thank you S Adil đŠđ« for your answer
0
Nikhil Maroju just mark as correct my answerđ