in reply to Regex Homework
A good approach to abstract problems with regular expessions is to write down some concrete examples and then look at these to see a common pattern emerging. I will not do the complete work for you, because much of the process lies in thinking about what "good" concrete examples are, and in thinking about whether you did find all relevant examples or not.
For your case a), the following list could be interesting:
abc abababc ababcab abcabab abcabcab abcabcccccccccccccccab
Another thing that will be helpfull for you to meditate over is the relation between the terms "odd" and "even". A nonnegative whole number is called "odd", if the number before it is called "even". A number is called "even", if the number before it is called "odd", or if it is zero.
If you still have problems going forward with this, start with an easier example:
|
---|