Gary Herron wrote:
What to do about RE's that hit the recursion limit?
I haven't had a chance to look at the SRE code in detail yet, but expect that the problem is that the straightforward way to implement .*? is with a C function call. PCRE also implemented it with a function call; Python avoided the limit by forking PCRE and adding a heap-allocated stack and pushing states onto the stack instead of recursing, which is why pre avoids the recursion limit (well, until you fill up your entire heap). The problem is that the patches to do this were extensive and ugly. Maybe just fixing the problem for .* will be sufficient. Incidentally, before we go making lots of changes, has anyone actually pinged Fredrik about the SRE code? His usual approach with software is to process patches and TODO items every N months; maybe he just hasn't gotten around to looking at the SRE backlog? --amk (www.amk.ca) KENT: Thou whoreson zed! thou unnecessary letter! -- _King Lear_, II, ii