title: Repeatedly extract a line between two delimiters in a text file, Python
body: <p>I have a text file in the following format:</p>
  
  <pre><code>DELIMITER1
  extract me
  extract me
  extract me
  DELIMITER2
  </code></pre>
  
  <p>I'd like to extract every block of <code>extract me</code>s between DELIMITER1 and DELIMITER2 in the .txt file</p>
  
  <p>This is my current, non-performing code:</p>
  
  <pre><code>import re
  def GetTheSentences(file):
       fileContents =  open(file)
       start_rx = re.compile('DELIMITER')
       end_rx = re.compile('DELIMITER2')
  
       line_iterator = iter(fileContents)
       start = False
       for line in line_iterator:
             if re.findall(start_rx, line):
  
                  start = True
                  break
        while start:
             next_line = next(line_iterator)
             if re.findall(end_rx, next_line):
                  break
  
             print next_line
  
             continue
        line_iterator.next()
  </code></pre>
  
  <p>Any ideas?</p>