I would like to validate a string for letters A-Z, AA-ZZ, AAA-ZZZ, and so on with a regex. I know [A-Z] will validate the first case but what about the others.
A, B, C, D, E, .... Z
or
AA, BB, CC, DD, EE, .... ZZ
or
AAA, BBB, CCC, DDD, EEE, ... ZZZ
and so on…
You can use backreference, if your regex engine supports it: