Py 1.5.2 -> Py 2.1.1 broke regular expression?

Stefan Schwarzer s.schwarzer at ndh.net
Sat Aug 11 15:59:19 EDT 2001


Hello

I have a program which _ran fine with Python 1.5.2_ but fails with Python
2.1.1. Its purpose is to extract IRC log sessions from several log files
and sort them into one file in the correct order (by date/time).

To do this, it uses (in effect) something like
  re.compile(pattern).findall(log_lines)

That works fine with the pattern string
  ^Session Start: \w{3} \w{3} .*?^Session Close: \w{3} \w{3} .*?$
but raises a
  RuntimeError: maximum recursion limit exceeded
in re.compile(pattern).findall(log_lines) when used with the pattern
  ^IRC log started \w{3} \w{3} .*?(?=\012IRC log started \w{3} \w{3} |\Z)

First, I thought it was because of the number of IRC sessions but the program
fails with the second pattern even for few (5) sessions. It used to handle
much larger numbers.

Any hints? A bug or a change in the regular syntax; anything else?

Thanks in advance for the answers :-)

Stefan



More information about the Python-list mailing list