Message137147
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 0x025C3C60>
<_sre.SRE_Match object at 0x025C3C60>
>>> re.match("()*?1", "a1")
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
re.match("()*?1", "a1")
File "C:\Python27\lib\re.py", line 137, in match
return _compile(pattern, flags).match(string)
MemoryError
>>> re.match("()+?1", "a1")
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
re.match("()+?1", "a1")
File "C:\Python27\lib\re.py", line 137, in match
return _compile(pattern, flags).match(string)
MemoryError
Note that when matching to a string starting with "1", the matcher will not throw a MemoryError. |
|
Date |
User |
Action |
Args |
2011-05-28 19:43:56 | Matthew.Boehm | set | recipients:
+ Matthew.Boehm, pitrou, ezio.melotti, mrabarnett, skrah, EungJun.Yi |
2011-05-28 19:43:56 | Matthew.Boehm | set | messageid: <1306611836.28.0.0725696673474.issue12177@psf.upfronthosting.co.za> |
2011-05-28 19:43:55 | Matthew.Boehm | link | issue12177 messages |
2011-05-28 19:43:55 | Matthew.Boehm | create | |
|