I\'m banging my head against a wall. I want a regex that matches: empty string, A, AB, and ABC, but not AC. I have this,
A
AB
ABC
AC
This should do it:
/^A(BC?)?$/