title: Multiline python regex
body: <p>I have a file structured like this : </p>
  
  <pre><code>A: some text
  B: more text
  even more text
  on several lines
  A: and we start again
  B: more text
  more
  multiline text
  </code></pre>
  
  <p>I'm trying to find the regex that will split my file like this :</p>
  
  <pre><code>&gt;&gt;&gt;re.findall(regex,f.read())
  [('some text','more text','even more text\non several lines'),
   ('and we start again','more text', 'more\nmultiline text')]
  </code></pre>
  
  <p>So far, I've ended up with the following :</p>
  
  <pre><code>&gt;&gt;&gt;re.findall('A:(.*?)\nB:(.*?)\n(.*?)',f.read(),re.DOTALL)
  [(' some text', ' more text', ''), (' and we start again', ' more text', '')]
  </code></pre>
  
  <p>The multiline text is not catched. I guess is because the lazy qualifier is really lazy and catch nothing, but I take it out, the regex gets really greedy :</p>
  
  <pre><code>&gt;&gt;&gt;re.findall('A:(.*?)\nB:(.*?)\n(.*)',f.read(),re.DOTALL)
  [(' some text',
  ' more text',
  'even more text\non several lines\nA: and we start again\nB: more text\nmore\nmultiline text')]
  </code></pre>
  
  <p>Does any one has an idea ? Thanks !</p>