Dear group members,

We need to capture more than 99 named groups using python regular expressions.  From the docs and from this thread ( http://groups.google.com/group/comp.lang.python/browse_thread/thread/a39a91b4bf8e3df4/2ad4a7e01b60215d?lnk=st&q=python+regular+_expression_+group+limit&rnum=3#2ad4a7e01b60215d) its clear why the language designers have decided on this limitation.  For our system, however, it is essential that we be able to capture an arbitrary number of groups. 

Could anyone on the list suggest what parts of the library code make assumptions about this restriction? We'd like to make some local changes to the core library to allow us to continue the development of our system (we don't want to switch to another language). We removed the condition in sre_compile.py that raises an exception for compiled regexps with more than 100 groups.  This allowed us to compile a regular _expression_ with more than 100 groups, but subsequent attempts to match or search with that regular _expression_ resulted in segfaults.

Thanks,
Richard Meraz





I realize this has been discussed before here:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/a39a91b4bf8e3df4/2ad4a7e01b60215d?lnk=st&q=python+regular+_expression_+group+limit&rnum=3#2ad4a7e01b60215d


--
Never think there is anything impossible for the soul. It is the greatest heresy to think so. If there is sin, this is the only sin – to say that you are weak, or others are weak.

Swami Vivekananda
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to