Regular expression for {$w:w$ starts with $0$ and has odd length, or starts with $1$ and has even length}

2.1k Views Asked by At

Problem in my textbook.

Give a regular expression for the language

{$w:w$ starts with $0$ and has odd length, or starts with $1$ and has even length}

alphabet is $\{0,1\}^*$

My answer: $(0\cup1(0\cup1))((0\cup1)(0\cup1))^* $

Is it correct?