Regular expression help

Andrew Bennetts andrew-pythonlist at puzzling.org
Thu Jul 17 01:10:36 EDT 2003


On Thu, Jul 17, 2003 at 04:27:23AM +0000, David Lees wrote:
> I forget how to find multiple instances of stuff between tags using 
> regular expressions.  Specifically I want to find all the text between a 
                                               ^^^^^^^^

How about re.findall?

E.g.:

    >>> re.findall('BEGIN(.*?)END', 'BEGIN foo END   BEGIN bar END') 
    [' foo ', ' bar ']

-Andrew.






More information about the Python-list mailing list