Whats up with re module vs pre

pythonUser_07 zsolt-googleP6463 at mailblocks.com
Thu Feb 17 16:32:00 EST 2005


This is a very generic observation as I don't have a lot of specifics
with me right now.  I have noticed over the past two years that the
python "re" module is somewhat unreliable.  At the suggestion of
someone quite some time ago, I started to use the deprecated "pre"
module. "import pre as re". All my problems went away.

So here I am two years later, writing another script and I had
forgotten about "pre" and wallah

$ python proc.py
Traceback (most recent call last):
  File "proc.py", line 39, in ?
    c = collect("nohup.out")
  File "proc.py", line 20, in collect
    m = p.search(cont)
RuntimeError: maximum recursion limit exceeded

As soon as I switched "import re" to "import pre as re" my program
worked as expected.   In the words of Jerry Sienfeld, what's up with
that?




More information about the Python-list mailing list