more than 100 capturing groups in a regex

Frithiof Andreas Jensen frithiof.jensen at die_spammer_die.ericsson.com
Tue Oct 25 04:59:07 EDT 2005


"Joerg Schuster" <joerg.schuster at gmail.com> wrote in message
news:1130160675.270886.208420 at z14g2000cwz.googlegroups.com...
Hello,

Python regular expressions must not have more than 100 capturing
groups.

Really ??

I have been waiting a long time now for Python to get rid of this
limitation.

Ahh - The "dark side" of Open Source:

If nobody cares, then you will have to do it yourself (and often people do
not care because nobody had the need to go there - for good reasons).

My question is: Does anyone know if the problem is going to be fixed in
the next few months or so? Or is there a way to circumvent it?

After a quick glean across the source code for the sre module, it appears
that the only place the code mentions a limit of 100 groups is in fact the
place that you quote.

I suspect it is there for some historic reason -  the people to ask is of
course "pythonware.com" who wrote it; there may well be a good reason for
the limitation.

What happens if you up the limit to whatever you need?





More information about the Python-list mailing list