[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

Matthew Barnett report at bugs.python.org
Wed Jul 29 02:56:32 CEST 2009


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

issue2636-20090729.zip contains regex.py, _regex.h, _regex.c which will
work with Python 2.5 as well as Python 2.6, and also 2 builds of
_regex.pyd (for Python 2.5 and Python 2.6 on Windows).

This version supports accessing the capture groups by subscripting the
match object, for example:

>>> m = regex.match("(?<foo>.)(?<bar>.)", "abc")
>>> len(m)
3
>>> m[0]
'ab'
>>> m[1 : 3]
['a', 'b']
>>> m["foo"]
'a'

----------
Added file: http://bugs.python.org/file14592/issue2636-20090729.zip

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2636>
_______________________________________


More information about the Python-bugs-list mailing list