Message140152
The new regex imlementation is hosted here: https://code.google.com/p/mrab-regex-hg/
The span of m['a_thing'] is m.span('a_thing'), if that helps.
The named groups are listed on the pattern object, which can be accessed via m.re:
>>> m.re
<_regex.Pattern object at 0x0161DE30>
>>> m.re.groupindex
{'another_thing': 3, 'a_thing': 1}
so you can use that to create a reverse dict to go from the index to the name or None. (Perhaps the pattern object should have such a .group_name attribute.) |
|
| Date |
User |
Action |
Args |
| 2011-07-11 17:32:08 | mrabarnett | set | recipients:
+ mrabarnett, loewis, georg.brandl, collinwinter, gregory.p.smith, jimjjewett, sjmachin, amaury.forgeotdarc, belopolsky, pitrou, nneonneo, giampaolo.rodola, rsc, timehorse, mark, vbr, ezio.melotti, jaylogan, akitada, moreati, alex, r.david.murray, jacques, brian.curtin, zdwiel, jhalcrow, stiv, davide.rizzo, ronnix, akoumjian |
| 2011-07-11 17:32:08 | mrabarnett | set | messageid: <[email protected]> |
| 2011-07-11 17:32:08 | mrabarnett | link | issue2636 messages |
| 2011-07-11 17:32:07 | mrabarnett | create | |
|