Author thatch
Recipients thatch
Date 2012-08-28.15:42:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I found this out in Pygments, where we use some alternations to match long strings/comments/etc in one go.  Someone else (with a similar use case) has found this same problem at

To reproduce:

>>> x = re.compile(r'a+')
>>> x.match('a' * 22000) 
<org.python.modules.sre.MatchObject object at 0x2>

Simply adding a grouping operator breaks it.

>>> x = re.compile(r'(?:a)+')
>>> x.match('a' * 22000)     
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion limit exceeded

With [Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_31
Date User Action Args
2012-08-28 15:42:27thatchsetrecipients: + thatch
2012-08-28 15:42:27thatchsetmessageid: <>
2012-08-28 15:42:26thatchlinkissue1965 messages
2012-08-28 15:42:26thatchcreate