title: Get lines until ^$
body: <p>I have this file</p>
  
  <pre><code>line 1
  line 2
  line 3
  
  line 4    
  line 5
  line 6
  </code></pre>
  
  <p>how I can get from <code>line 1</code> to <code>line 3</code>? </p>
  
  <p>I tried: </p>
  
  <pre><code>print re.match(r'(.*)^$', lines, re.MULTILINE).groups()
  </code></pre>
  
  <p>but I get: </p>
  
  <pre><code>AttributeError: 'NoneType' object has no attribute 'groups'
  </code></pre>