maximum recursion in "re" module?

Skip Montanaro skip at pobox.com
Mon Oct 15 21:13:25 EDT 2001


    CJ>   startString = ".*?Lo Fi Play</phrase></a> <phrase><a href=\""
    ...    
    CJ>   mp3String = re.compile(startString, re.I).sub("", mp3String, 1)

Why do you need the ".*?" part of the re?  I'd try this:

    startString = "Lo Fi Play</phrase></a> <phrase><a href=\""

If you can get by without it, I think that will cure your problems.  If not,
you can always import pre instead:

    import pre as re

or

    try:
        # only in 2.x I believe
        import pre
        re = pre
        del pre
    except ImportError:
        import re





More information about the Python-list mailing list