You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.;
public class Solution {
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); scanner.nextLine(); for(int i = 0; i<n; i++){ String word = scanner.nextLine(); if(word.matches("^[a-zA-Z][a-zA-Z0-9_]{7,29}$")) System.out.println("Valid"); else System.out.println("Invalid"); } }
}
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 →
import java.io.; import java.util.;
public class Solution {
}