title: In Python, how do I extract multiple blocks of text that begin with same pattern, but no distinct end?
body: <p>Given a test string:</p>
  
  <pre><code>teststr= 'chapter 1 Here is a block of text from chapter one.  chapter 2 Here is another block of text from the second chapter.  chapter 3 Here is the third and final block of text.'
  </code></pre>
  
  <p>I want to create a list of results like this:</p>
  
  <pre><code>result=['chapter 1 Here is a block of text from chapter one.','chapter 2 Here is another block of text from the second chapter.','chapter 3 Here is the third and final block of text.']
  </code></pre>
  
  <p>Using <code>re.findall('chapter [0-9]',teststr)</code></p>
  
  <p>I get <code>['chapter 1', 'chapter 2', 'chapter 3']</code></p>
  
  <p>That's fine if all I wanted were the chapter numbers, but I want the chapter number plus all the text up to the next chapter number.  In the case of the last chapter, I want to get the chapter number and the text all the way to the end.</p>
  
  <p>Trying <code>re.findall('chapter [0-9].*',teststr)</code> yields the greedy result:
  <code>['chapter 1 Here is a block of text from chapter one.  chapter 2 Here is another block of text from the second chapter.  chapter 3 Here is the third and final block of text.']</code></p>
  
  <p>I'm not great with regular expressions so any help would be appreciated.</p>