Conditions:-
Valid:-
Invalid:-
I have come up with this regex: '^[A-A][B-B][A-Z0-9]{10}$'. It prevents Invalid #2 and #3. But I'm having a hard time with Invalid #1. I know that to prevent all characters from being 0, I need to use '^0+$'. But how do I combine these two expressions?
You can add a negative lookahead to accomplish this: (?!0{10}).
^[A-A][B-B](?!0{10})[A-Z0-9]{10}$
^^^^^^^^^
By the way, you don't need [A-A][B-B]. Just AB does exactly the same.