title: Using regex to get passage between two strings in Python
body: <p>I want to parse all of the functions inside of a .txt file. It looks like this:</p>
  
  <pre><code>def
    test
  end
  
  def
    hello
  end
  
  def
    world
  end
  </code></pre>
  
  <p>So, I would get the following returned: <code>[test, hello, world]</code></p>
  
  <p>Here is what I have tried, but I do not get anything back:</p>
  
  <pre><code>    r = re.findall('def(.*?)end', doc)
      print r
  </code></pre>