We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Valid Username Regular Expression
Valid Username Regular Expression
Sort by
recency
|
461 Discussions
|
Please Login in order to post a comment
public static final String regularExpression = "^[^\\W_\\d][\\w]{7,29}$";
[a-zA-Z] Matches any letter at the beggining
[a-zA-Z0-9_] Matches any letter, digit or underscore. Equivalent to \w.
{7,29} From 8 to 30, but counting here the beggining letter.
short and enough public static final String regularExpression = "[a-zA-Z][a-zA-Z0-9_]{7,29}";
this regex consits of: 1. one and only one alphabitic charachter at the begining 2. and 7 : 29 alphabitic, numeric or under score charachters.