I am stuck on solving the regex for all username constraints - the is the latest regex i came up with that fits all constraints except Not matching A1.
userCheck = /^[a-z]+[a-z|0-9]\d*$/i;
^[a-z] + username must begin with a alphabet letter and occurs more than once
[a-z|0-9] character can be alphabet letter or number
\d*$ number can exsist 0 or more times at end of username
I am finding it difficult to meet the constraint of a 2 character username using only alphabet characters, but also allowing the second character to be a number if the username is > 2 characters.
I tried removing the OR quantifier with the following code:
let userCheck = /^[a-z][a-z]+\d*$/i;
but then username Z97 does not pass the test.
I feel like I am missing something very obvious… If anyone has any pointers and tips would be very helpful and much appreciated!