Pretty much what the question says. I came up with
(ba)?(a + bb + bbbbb + aba)*(ab)?
Is there anything more readable? Or is this incorrect? I know you shouldn't really be doing this sorta thing with Regex when you can just go !~/bbb/ in your code, but it's a theory exercise.
Thanks.
Edit for Clarification: I'm not using |
to represent the OR bit in the Regex and using +
it instead. Sorry for the confusion.
Edit 2: {a,b}
is for a language with just 'a' and 'b' characters. Not {mininum, maximum}. Sorry again.
Edit 3: Because this is part of a theory class, we're just dealing with the basics of Regex. The only things you're allowed to use are +, ?, () and *. You cannot use {minimum, maximum).