I am not so great at regular expressions so I would like to understand if the regular expression which I have made is ok or it can be improved.
Regular expression conditions:
- Maximum 20 characters allowed.
- First 3 - 4 characters should be alphanumeric. It can either be 3 or 4 characters.
- The next character should be a underscore(_) only.
- Followed by that there can be another 1-15 alphanumeric characters.
I have made a regular expression like this :
^[[:alnum:]]{3,4}(_)[[:alnum:]]{1,15}$
Is this a good practice or can I improve further?
Thanks for your help in advance.