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
/
^(?:([A-D])(?!.*?\1),)*[A-D]$
/
gm
Input 1
1
New
Some matches would be: A C C,B B,D D,B,A,C Some no matches would be: A,A ABC D,B,A,B