You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int size = scanner.nextInt(); scanner.nextLine(); for (int i = 0; i < size; i++) { System.out.println(scanner.nextLine().matches("[a-zA-Z][a-zA-Z0-9_]{7,29}") ? "Valid" : "Invalid"); } scanner.close(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Valid Username Regular Expression
You are viewing a single comment's thread. Return to all comments →