From: Tim H. <re...@bu...> - 2012-08-28 15:42:34
|
New submission from Tim Hatch: 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 ---------- components: Library messages: 7432 nosy: thatch severity: normal status: open title: Unable to match long strings with re type: behaviour versions: 2.5.3b1, 2.7a2 _______________________________________ Jython tracker <re...@bu...> <http://bugs.jython.org/issue1965> _______________________________________ |