Message7432

Author thatch
Recipients thatch
Date 2012-08-28.15:42:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346168547.07.0.836035122143.issue1965@psf.upfronthosting.co.za>
In-reply-to
Content
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 http://comments.gmane.org/gmane.comp.java.grinder.user/2325

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
History
Date User Action Args
2012-08-28 15:42:27thatchsetrecipients: + thatch
2012-08-28 15:42:27thatchsetmessageid: <1346168547.07.0.836035122143.issue1965@psf.upfronthosting.co.za>
2012-08-28 15:42:26thatchlinkissue1965 messages
2012-08-28 15:42:26thatchcreate