I'm working on some homework for my compiler class and I have the following problem:
Write a regular expression for all strings of a's and b's that contain an odd number of a's or an odd number of b's (or both).
After a lot of whiteboard work I came up with the following solution:
(aa|bb)* (ab|ba|a|b) ((aa|bb)* (ab|ba) (aa|bb)* (ab|ba) (aa|bb)*)*
However, Is this is the most simplified I can get it? I've considered constructing the DFA trying to minimize the number of states there to see if it would help me simplify but I figured I would ask the regex gurus on SO first.