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

Matthew Barnett report at bugs.python.org
Sat Mar 7 03:48:17 CET 2009


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

issue2636-features-6.diff includes:

Bugfixes
Added group access via subscripting.

>>> m = re.search("(\D*)(?<number>\d+)(\D*)", "abc123def")
>>> len(m)
4
>>> m[0]
'abc123def'
>>> m[1]
'abc'
>>> m[2]
'123'
>>> m[3]
'def'
>>> m[1 : 4]
('abc', '123', 'def')
>>> m[ : ]
('abc123def', 'abc', '123', 'def')
>>> m["number"]
'123'

Added file: http://bugs.python.org/file13257/issue2636-features-6.diff

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


More information about the Python-bugs-list mailing list