@@ -0,0 +1,668 @@
+import java.util.Scanner;%0Aclass UsernameValidator %7B%0A    /*%0A     * Write regular expression here.%0A     */%0A    public static final String regularExpression = %22%5BA-Za-z%5D%5BA-Za-z0-9_%5D%7B7,29%7D%22;%0A%7D%0A%0A%0Apublic class Solution %7B%0A    private static final Scanner scan = new Scanner(System.in);%0A%0A    public static void main(String%5B%5D args) %7B%0A        int n = Integer.parseInt(scan.nextLine());%0A        while (n-- != 0) %7B%0A            String userName = scan.nextLine();%0A%0A            if (userName.matches(UsernameValidator.regularExpression)) %7B%0A                System.out.println(%22Valid%22);%0A            %7D else %7B%0A                System.out.println(%22Invalid%22);%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Solve username checker