I'm trying to create a regular expression that will allow only specific usernames
- Only starts with alphabet.
- Only ends with either number or an alphabet.
- Only allowed - if contains alphabets only or only one dot with alphabets, only one underscore with alphabets.
- Cannot starts with dot or underscore
- Length of username should be only in 4 to 10 char
this is what i am doing - ^(?=[a-zA-Z0-9._]{4,10}$)(?!.*[_.]{2})[^_.].*[^_.]$