Can someone please tell me how to generate a regular expression for strings in which number of a's is a multiple of 3? The alphabet set is {a,b}.
I tried to construct a DFA for it first and then derive a RE from that. What I got was ((ba*)(ba*)(ba*))*.
I would write the pattern as:
This matches:
^from the start of the stringb*optional leadingbzero or more times(?:(?:ab*){3}matchafollowed by zero or moreb3 times)*match this group zero or more times$end of the stringDemo