Hello stackoverflow community!
I want to match all (same-length) string permutations of AAB, so I want to match:
AAB
BAA
ABA
but not:
ABB
AB
AABA
I have already found many sources mentioning lookarounds and backreferences at similar questions such as [1] or [2] but I am struggling with repeated characters such as "AA".
I have tried:
^(?=[AAB]{3}$)(?!.*(.).*\1).*$
^([AAB])(?!\1)([AAB])(?!\1|\2)([AAB])(?!\1|\2|\3)$
Do you have any ideas on that? Thanks in advance!