I have a regular expression of the following:
.regex(/^(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{4})$/)
Must be exactly 4 characters Must contain at least 1 numeric and 1 alpha
Although I rarely do regular expression, this was relatively easy. I now have a new requirement that I have tried to implement, but cannot get right.
New requirement: Be able to have a comma separated list of the same type of input as before. Cannot end with a comma. Each item must be valid per the rules above (4 characters, at least on numeric, at least one alpha)
Valid: 123F,U6Y7,OOO8
Invalid: Q2R4,
Invalid: Q2R4,1234
Invalid: Q2R4,ABCD
Invalid: Q2R4,N6
I very much appreciate your help! Thanks!