Update 2017-05-17: TODO
Before we get to named capture groups, let’s take a look at numbered capture groups; to introduce the idea of capture groups.
Numbered capture groups
Numbered capture groups enable you to take apart a string with a regular expression.
Successfully matching a regular expression against a string returns a match object
matchObj. Putting a fragment of the regular expression in parentheses turns that fragment into a capture group: the part of the string that it matches is stored in
Prior to this proposal, all capture groups were accessed by number: the capture group starting with the first parenthesis via
... read the whole story at 2ality.com.