Constructing regular expressions is usually more complicated than programming finite state automata. The standard way would be to construct a FSA and translate that one into a regular expression using standard techniques.
But if you prefer, it can be done directly, in two steps. Start by making two regular expressions $\alpha$ and $\beta$.
- First $\alpha$ specifies strings with even number of $1$'s, and exactly two
$0$'s, one of which is the last symbol of the string.
- Similarly $\beta$ specifies strings with odd number of $1$'s, and exactly two $0$'s,
one of which is the last symbol of the string.
Then build an expression for strings that have an even number of $0$ ánd an even number of $1$'s based on $\alpha$ and $\beta$.
1
s and Even number of0
s $\endgroup$ – Grijesh Chauhan Apr 29 '15 at 3:190
s can be written as simply written as(1 + 01*0)*
your regex is complete $\endgroup$ – Grijesh Chauhan Apr 29 '15 at 3:23