If I'm not mistaken, this can only happen if the string (of length 1 or bigger):
- Contains only 0's
- Contains only 1's
- Begins with a sequence of 1 or more 1's and then a sequence of 0's
Is there any other possibility?
If that's the case, then
/^(0+|1+0*)$/
Anyway, in the practical sense, I'd just negate the match.
if (!/01/) { ... }