i have a regex
^[a-zA-Z0-9]{0,14}$
which will allow only alphanumerics.
but there is problem i dont want a username to be only numbers and this regex is accepting only numbers also
like 56426542
so how to restrict only numbers
i have a regex ^[a-zA-Z0-9]{0,14}$ which will allow only alphanumerics. but there is problem
Share
The regex you want:
Regex sandbox to play in with it.
This won’t force you to have to start with a letter. The username can start with a letter or a number, an ensures that the username isn’t only numbers.
Edit: fixed the length check. Also, you might want to change the {0,14} to {1,14}. Well, replace the first number with your minimum length requirement.