Regex error?

Drew Fisher drew at
Thu Jun 7 10:37:45 EDT 2001


I'm trying to write a python script to parse an email header for IP
addresses and dates, and I keep on getting an error that says:

RuntimeError: maximum recursion limit exceeded

The regex is a little lengthy, but I didn't think it would be a

rfc822_re = re.compile ('\[(\d+\.\d+\.\d+\.\d+)\].*?\w+,\s+(\d+\s+\w+\s+\d+)\s+(\d+:\d+:\d+)\s+(\w+)')

The script dies when I try to do:

rfc822_test = rfc822_re.findall (rawdata)

rawdata is just a string containing the entire email.

The regex finds the IP address, the date, the time, and the timezone
from where the email address came.

Can anyone tell me what that error means, and how I could possibly get
around it?


Drew Fisher

More information about the Python-list mailing list