Regular expression to match string of 0's and 1's without '011' substring

Prasoon Saurav picture Prasoon Saurav · Apr 17, 2010 · Viewed 15.7k times · Source

I'm working on a problem (from Introduction to Automata Theory, Languages and Computer by Hopcroft, Motwani and Ullman) to write a regular expression that defines a language consisting of all strings of 0s and 1s not containing the substring 011.

Is the answer (0+1)* - 011 correct ? If not what should be the correct answer for this?

Answer

RJFalconer picture RJFalconer · Apr 17, 2010

Automata diagram Edit: Updated to include start states and fixes, as per below comments.