in reply to Trying to count the captures in a compiled regular expression

You are trying to parse a context free language with a regular expression. So as some advice for you: you'll probably do it a lot easier with an actual parser.

  • Comment on Re: Trying to count the captures in a compiled regular expression