Is there an alternative to Match.regs
? It is undocumented, and I see a proposal to remove it at http://bugs.python.org/issue18043, but it is useful to me. Here's it's usage:
> m = re.match('(a) (b)', 'a b ')
> m
<_sre.SRE_Match object; span=(0, 3), match='a b'>
> m.regs
((0, 3), (0, 1), (2, 3))
Is there an alternative way to obtain the spans of those groups for non-trivial regex?
Alternatives:
I wouldn't worry too much about it, though, as at this point it still exists in 3.5.