You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args){ Scanner in = new Scanner(System.in); int testCases = Integer.parseInt(in.nextLine()); while(testCases>0){ String pattern = in.nextLine(); //Write your code try{ Pattern a = Pattern.compile(pattern); System.out.println("Valid"); }catch(PatternSyntaxException ea){ System.out.println("Invalid"); } testCases--; } }
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 →