re module question

Skip Montanaro skip at pobox.com
Thu Dec 27 23:23:13 EST 2001


    David>    patt = re.compile("mailto:(.*)\">.*",re.I)

    David>   match = patt.search(tststring)
    David>   if match:
    David>      email = match.group(1)

    David> I can locate the first instance of mailto: . . . but what if I
    David> have a document with more than once instance of the match.  How
    David> do I pick them out?

You probably want re.findall...

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list