You are viewing a single comment's thread. Return to all comments →
public class Solution {
public static void main(String[] args) throws IOException{ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int numInputs = Integer.parseInt(reader.readLine()); for (int i = 0; i < numInputs; i++){ String pattern = reader.readLine(); try{ Pattern pat=Pattern.compile(pattern); System.out.println("Valid"); }catch(Exception e){ System.out.println("Invalid"); } } }
}
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 →
public class Solution {
}