[New-bugs-announce] [issue12177] re.match raises MemoryError

EungJun Yi report at bugs.python.org
Wed May 25 20:04:25 CEST 2011


New submission from EungJun Yi <semtlenori at gmail.com>:

re.match raises MemoryError when trying to match r'()+?1' to 'a1', as shown below.

~$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.match(r'()+?1', 'a1')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/re.py", line 137, in match
    return _compile(pattern, flags).match(string)
MemoryError
>>>

~$ python3
Python 3.2 (r32:88445, Mar 25 2011, 19:28:28) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.match(r'()+?1', 'a1')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.2/re.py", line 153, in match
    return _compile(pattern, flags).match(string)
MemoryError
>>>

----------
components: Regular Expressions
messages: 136880
nosy: EungJun.Yi
priority: normal
severity: normal
status: open
title: re.match raises MemoryError
type: resource usage
versions: Python 2.7, Python 3.2

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


More information about the New-bugs-announce mailing list