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
/
(?!.?C.?C)([ABC]{3})
/
gm
Input 1
1
New
Find 3 characters together. All of the characters must be from the group 'ABC' 0 to 3 of them can be 'A' 0 to 3 of them can be 'B' 0 to 1 of them can be 'D' In which case the following would match: ABC ACB CBA BCA AAB ABA BAA AAC ACA CAA ABB BAB BBA BBB and the following would not match: CCC CCA CAC ACC CCB CBC BCC
Substitution
Find 3 characters together. All of the characters must be from the group 'ABC' 0 to 3 of them can be 'A' 0 to 3 of them can be 'B' 0 to 1 of them can be 'D' In which case the following would match: ABC ACB CBA BCA AAB ABA BAA AAC ACA CAA ABB BAB BBA BBB and the following would not match: CCC CCA CAC ACC CCB CBC BCC