# Regular expression for string with substring 010 and ending with 01

How can one design a regular expression for given string in title ?

Also how can we draw DFA of that regular expression?

• – D.W. Mar 11 '18 at 17:52

The regular expression would be like $(0 + 1)^*010(0 + 1)^*01 + (0 + 1)^*0101$. Transformation of a regular expression to a DFA has a well-defined algorihtms, and you can find them in the resources.

Not the best photo quality , but it will work. I think this DFA is the one but correct me if i'm wrong. :)