Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\b(?=[A-Z]{5}\b)(?:\1|(?!\2)([B-Z])()|(?!\3)A())+\b\2
/
gm
Input 1
1
New
BBABB -> true ABBBB -> true BABBB -> true CCACC -> true CCCCA -> true AAAAA -> false (change "[B-Z]" to "[A-Z]" to match this) CCBAB -> false CCCAA -> false ABCCB -> false BACBB -> false