maximum recursion in "re" module?

Andrew Markebo flognat at flognat.myip.org
Wed Oct 17 03:57:58 EDT 2001


/ Skip Montanaro <skip at pobox.com> wrote:
|     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:

Ah small and quick follow up, I have the same problems, but then my
re's look something like
        "<A.*?</A>"

Why do they do a stack overflow, shouldn't it be finished/work out
faster than a "<A.*</A>" (yeah I know not the same regexp, just
thinking)

And well "do a html-parser instead" is not the correct answer, it is
not only html I try stuff like this on.


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

pre? What is that? Previous re?

        /Andy

-- 
 The eye of the beholder rests on the beauty!



More information about the Python-list mailing list