@@ -0,0 +1,641 @@
+import java.util.Scanner;%0Aimport java.util.regex.*;%0A%0A// https://www.hackerrank.com/contests/30-days-of-code/challenges/day-28-regex-patterns-intro-to-databases/submissions/code/4906823%0A%0Apublic class Solution%0A%7B%0A   public static void main(String%5B%5D args)%7B%0A      Scanner in = new Scanner(System.in);%0A      int testCases = Integer.parseInt(in.nextLine());%0A      while(testCases--%3E0)%7B%0A         String pattern = in.nextLine();%0A         %0A          try %7B%0A              Pattern.compile(pattern);%0A              System.out.println(%22Valid%22);%0A          %7D catch (Exception ignored) %7B%0A              System.out.println(%22Invalid%22);%0A          %7D%0A      %7D%0A   %7D%0A%7D%0A

Create Day28-Regex.java