I'm starting with RegEx and I need help, I want to validate that there are two equal characters followed by A, or that they are separated (but remain the same) and in the middle A. I explain with examples:
BBA -> true
ABB -> true
BAB -> true
CCA -> true
ABC -> false
BAC -> false
BBBA -> false (there have to be only two)
ABBB -> false (there have to be only two)
At the moment I have something similar to this, but it does not work correctly:
(([B-Z])\1{2}A) | ([B-Z]{1}A[B-Z]{1}) | (A([B-Z])\1{2})
I know I'm not getting close to the correct answer, what I'm learning. If someone could give me a hand I would appreciate it very much.