Need to construct a regular expression that recognizes the following language of strings over the alphabet {a,b}: - The set of all strings over alphabet {a,b} in which every occurrence of b is followed by at least two a's. For example, the empty string is in this language, as is every string consisting solely of a's. The string abaa is in the language, but aba is not.
What i have come up with is a*b*a{2,} but that do not accept the empty string.
(a*(baa)*)* should work.
We enforce the constraint, as well as allow the whole pattern to be repeated any number of times to allow generation of other legal strings.