You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) { Scanner scan = new Scanner(System.in); int cnt = scan.nextInt(); scan.nextLine(); for (int i = 0; i < cnt; i++){ try{ Pattern.compile(scan.nextLine()); } catch (Exception e){ System.out.println("Invalid"); continue; } System.out.println("Valid"); } scan.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 →