@@ -0,0 +1,525 @@
+import java.util.Scanner;%0Aimport java.util.regex.*;%0A%0Apublic class Solution%0A%7B%0A%09public static void main(String%5B%5D args)%7B%0A%09%09Scanner in = new Scanner(System.in);%0A%09%09int testCases = Integer.parseInt(in.nextLine());%0A%09%09for(int i = 0; i %3C testCases; i++)%7B%0A%09%09%09String pattern = in.nextLine();%0A            try %7B%0A                Pattern.compile(pattern);%0A                System.out.println(%22Valid%22);%0A            %7D catch (PatternSyntaxException e) %7B%0A                System.out.println(%22Invalid%22);%0A            %7D%0A%09%09%7D%0A        in.close();%0A%09%7D%0A%7D%0A

Solve java pattern syntax checker