Username regex

I want a regular expression for the username in asp.net/c#, where the username must be at least 6 and at most 15 characters. Alphanumeric characters are allowed. special characters ._ allowed. Without spaces. The start character must be an alphabet.

I want a regular expression for the password, where the conditions are exactly the same as above, but with the only difference that the initial character must be either alphanumeric or special characters.

+3
source share
1 answer

Username

[A-Za-z][A-Za-z0-9._]{5,14}

password

[A-Za-z0-9]{6,15}

but not allowing special characters in passwords is not reasonable

+11
source

All Articles