I'm trying to write a regular expression over the alphabet {0,1,2} for the language in which every 1 is preceded by 0. For example 2200201010, 01022020102012 are strings of the language.
I've tried with this:
(0+2)*(01)*(0+2)*(01)*(0+2)*
, where '+' means {0,2,00,02,20,22,.....}. Is this reg-exp correct? Thank you