Bottleneck? More efficient regular expression?

David Eppstein eppstein at ics.uci.edu
Tue Sep 23 19:01:16 CEST 2003


In article <3f7069db_4 at corp.newsgroups.com>,
 "Tina Li" <tina_li23 AT hotmail DOT com> wrote:

> I've been struggling with a regular expression for parsing XML files, 
> which keeps giving the run time error "maximum recursion limit 
> exceeded".

Why not use a real XML parser?  xml.parsers.expat is easy enough to use, 
doesn't have problems with recursion limits, and will continue working 
when someone generates a valid XML file in a slightly different version 
than the one you expect.

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science




More information about the Python-list mailing list