Regular expression help
abcdebl2nonspammy at verizon.net
Thu Jul 17 06:27:23 CEST 2003
I forget how to find multiple instances of stuff between tags using
regular expressions. Specifically I want to find all the text between a
series of begin/end pairs in a multiline file.
>>> p = 'begin(.*)end'
>>> m = re.search(p,s,re.DOTALL)
and got everything between the first begin and last end. I guess
because of a greedy match. What I want to do is a list where each
element is the text between another begin/end pair.
More information about the Python-list