You do not want username of two letters or username that has unlimited characters, do you? Consider this solution if you need to limit the number of characters in your username under your situation:
/^[a-z0-9][a-z0-9_]{2,28}[a-z0-9]$/
https://www.tinywebhut.com/regex/4
The part [a-z0-9] exactly matches one character which can be only small letter or number. The middle part [a-z0-9_]{2,28} matches any small letter or number up to 2 or 28 characters including underscore. The final part [a-z0-9] exactly matches one character which can be only small letter or number. Therefore, this regular expression matches username that has at least 4 characters and 30 characters at the most. If you change your mind and want to include both small and capital letters, you'll have to add a modifier i:
/^[a-z0-9][a-z0-9_]{2,28}[a-z0-9]$/i
https://www.tinywebhut.com/regex/5