SyntaxFix
Write A Post
Hire A Developer
Questions
Try this regular expression:
^(.{0,2}|([^A]..|A[^B].|AB[^C])|.{4,})$
It describes three cases:
A
B
C