Serhiy Storchaka added the comment:
This is a duplicate of issue9669.
--
nosy: +serhiy.storchaka
resolution: - duplicate
stage: needs patch - committed/rejected
status: open - closed
superseder: - regexp: zero-width matches in MIN_UNTIL
___
Python
Matthew Boehm boehm.matt...@gmail.com added the comment:
Here are some windows results with Python 2.7:
import re
re.match(()*?1, 1)
_sre.SRE_Match object at 0x025C0E60
re.match(()+?1, 1)
re.match(()+?1, 11)
_sre.SRE_Match object at 0x025C0E60
re.match(()*?1, 11)
_sre.SRE_Match object at
New submission from EungJun Yi semtlen...@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
Stefan Krah stefan-use...@bytereef.org added the comment:
Confirmed. The test case quickly uses 8GB of memory.
--
nosy: +ezio.melotti, pitrou, skrah
stage: - needs patch
versions: +Python 3.1, Python 3.3
___
Python tracker rep...@bugs.python.org
Matthew Barnett pyt...@mrabarnett.plus.com added the comment:
This also raises MemoryError:
re.match(r'()*?1', 'a1')
but none of these do:
re.match(r'()+1', 'a1')
re.match(r'()*1', 'a1')
--
nosy: +mrabarnett
___
Python tracker
EungJun Yi semtlen...@gmail.com added the comment:
This also raises in 2.6.5
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
import re
re.match('()+?1', 'a1')
Traceback (most recent call last):
File