Message7432
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 |
|
Date |
User |
Action |
Args |
2012-08-28 15:42:27 | thatch | set | recipients:
+ thatch |
2012-08-28 15:42:27 | thatch | set | messageid: <1346168547.07.0.836035122143.issue1965@psf.upfronthosting.co.za> |
2012-08-28 15:42:26 | thatch | link | issue1965 messages |
2012-08-28 15:42:26 | thatch | create | |
|