title: Regular expression matching a multiline block of text
body: <p>I'm having a bit of trouble getting a Python regex to work when matching against text that spans multiple lines. The example text is ('\n' is a newline)</p>
  
  <pre class="lang-none prettyprint-override"><code>some Varying TEXT\n
  \n
  DSJFKDAFJKDAFJDSAKFJADSFLKDLAFKDSAF\n
  [more of the above, ending with a newline]\n
  [yep, there is a variable number of lines here]\n
  \n
  (repeat the above a few hundred times).
  </code></pre>
  
  <p>I'd like to capture two things: the 'some_Varying_TEXT' part, and all of the lines of uppercase text that comes two lines below it in one capture (i can strip out the newline characters later). 
  I've tried with a few approaches:</p>
  
  <pre><code>re.compile(r"^&gt;(\w+)$$([.$]+)^$", re.MULTILINE) # try to capture both parts
  re.compile(r"(^[^&gt;][\w\s]+)$", re.MULTILINE|re.DOTALL) # just textlines
  </code></pre>
  
  <p>and a lot of variations hereof with no luck. The last one seems to match the lines of text one by one, which is not what I really want. I can catch the first part, no problem, but I can't seem to catch the 4-5 lines of uppercase text.
  I'd like match.group(1) to be some&#95;Varying&#95;Text and group(2) to be line1+line2+line3+etc until the empty line is encountered.</p>
  
  <p>If anyone's curious, its supposed to be a sequence of aminoacids that make up a protein.</p>