88k regex = RuntimeError

Diez B. Roggisch deets at nospam.web.de
Tue Feb 14 05:10:01 EST 2006


> I assume it's hitting some limit, but don't know where the limit is to
> remove it. I tried stepping into it repeatedly with Komodo, but didn't
> see the problem.

That's because it is buried in the C-library that is the actual
implementation. There has been a discussion about this a few weeks ago -
and AFAIK there isn't much you can do about that.

> Suggestions?

Yes. Don't do it :) After all, what you do is nothing but a simple
word-search. If I had that problem, my naive approach would be to simply
tokenize the sources and look for the words in them being part of your
function-name-set. A bit of statekeeping to keep track of the position, and
you're done. Check out pyparsing, it might help you doing the tokenization.


I admit that the apparent ease of the regular expression would have lured me
into the same trap.

Diez



More information about the Python-list mailing list