When you need to grab part of a regex for later use, why does .NET require dealing with both groups and captures? In my experience, the canonical method for dealing with regex captures has you numbering your captures starting at 1 from their opening parenthesis, so that in a regex like:
capture $1 is the whole quoted string, captures $2 and $4 are the quotes, and capture $3 is the quoted string itself.
In the .NET regex classes, you can't directly access the captures you must go through their containers, the
What would match my own personal model is where each
Capture would be linked somehow to the Captures contained within, with each
linked to all of its Captures in opening-parenthesis-first order like in the example above.. If there are no Captures, there is no link. ("Link" does not mean literal link it could just as well be some kind of collection reference.)
I suspect there is a use for Groups, but I'm not sure what it is. Maybe when you are generating your regexes with a program you could use a Group to simplify your code.