Valid Username Regular Expression

  • + 3 comments

    This is my code:

    String pattern = "^[a-zA-Z][\\w]{7,29}$";
    

    ^[a-zA-Z] = first word

    [\w] = any character

    {7,29}$ = number of words