[pypy-issue] [issue1665] Module re behavior different from CPython in Match.group

danblack tracker at bugs.pypy.org
Fri Dec 27 06:14:06 CET 2013


New submission from danblack <daniel.subs at internode.on.net>:

$ pypy -V
Python 2.7.3 (352c78d2e80f4a812ae1d8cdbe8c01a7f2e6fbc0, Aug 19 2013, 10:43:46)
[PyPy 2.1.0 with GCC 4.8.1 20130603 (Red Hat 4.8.1-1)]
(pypyenv) $ ipython
Python 2.7.3 (352c78d2e80f4a812ae1d8cdbe8c01a7f2e6fbc0, Aug 19 2013, 10:43:46)
In [1]: import re
In [2]: m = re.search('(?P<alpha>abc)','abcdef')
In [3]: m.group('CAT')
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-3-506c488db4df> in <module>()
----> 1 m.group('CAT')

KeyError: 'CAT'

CPython (2.7.5)
In [1]: import re
In [2]: m = re.search('(?P<alpha>abc)','abcdef')
In [3]: m.group('CAT')
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-3-506c488db4df> in <module>()
----> 1 m.group('CAT')

IndexError: no such group

----------
messages: 6446
nosy: danblack, pypy-issue
priority: bug
release: 2.1
status: unread
title: Module re behavior different from CPython in Match.group

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1665>
________________________________________


More information about the pypy-issue mailing list