public class test20 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Введите свое имя: ");
String name = scan.nextLine();
Pattern pat = Pattern.compile("[a-zA-Z]*");
Matcher mat = pat.matcher("Ваше имя" + name);
if (mat.matches()) {
System.out.println(name);
}else {
System.out.println("Вы вели некорректно!");
}
}
}
Pattern pattern = Pattern.compile("^((\\+?+380)([0-9]{9}))$");