You are viewing a single comment's thread. Return to all comments →
Scanner in = new Scanner(System.in); int testCases = Integer.parseInt(in.nextLine()); IntStream.rangeClosed(1, testCases) .forEach(value -> { String pattern = in.nextLine(); try { Pattern.compile(pattern); System.out.println("Valid"); } catch(PatternSyntaxException e) { System.out.println("Invalid"); } }); in.close();
Seems like cookies are disabled on this browser, please enable them to open this website
Pattern Syntax Checker
You are viewing a single comment's thread. Return to all comments →