This smells like homework.
Here's a few hints
- You'll want your regular expression to span multiple lines. This means you'll want the '.' special character to match against newlines. (This requires an option to be added to the regex.)
- Figure out what the "regular" parts of your "expression" are. For example, how would you tell a person who doesn't understand the example given how to solve the problem? That's how you have to tell the computer.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested