Reputation: 2065
I have managed to figure out the regular expression for even number of b's and odd number of a's through (bb|aa|(ba|ab)(bb|aa)*(ab|ba))*(a|(ba|ab)(aa|bb)*b)
What if I need the following sequence:
any idea?
Upvotes: 0
Views: 963
Reputation: 1
Expression for even no. of b's: (bb)*
Expression for odd no. of a's: (aa)*a
So the overall regular expression is:
(bb)*c(aa)*a
Upvotes: 0