title: Using python regex to find repeated values after a header
body: <p>If I have a string that looks something like:</p>
  
  <pre><code>s = """
  ...
  Random Stuff
  ...
  HEADER
  a 1
  a 3
  # random amount of rows
  a 17
  RANDOM_NEW_HEADER
  a 200
  a 300
  ...
  More random stuff
  ...
  """
  </code></pre>
  
  <p>Is there a clean way to use regex (in Python)  to find all instances of <code>a \d*</code> after HEADER, but before the pattern is broken by SOMETHING_TOTALLY_DIFFERENT? I thought about something like:</p>
  
  <pre><code>import re
  pattern = r'HEADER(?:\na \d*)*\na (\d*)'
  
  print re.findall(pattern, s)
  </code></pre>
  
  <p>Unfortunately, regex doesn't find overlapping matches. If there's no sensible way to do this with regex, I'm okay with anything faster than writing my own for loop to extract this data.</p>
  
  <p>(TL;DR -- There's a distinct header, followed by a pattern that repeats. I want to catch each instance of that pattern, as long as there isn't a break in the repetition.)</p>
  
  <p>EDIT:</p>
  
  <p>To clarify, I don't necessarily know what SOMETHING_TOTALLY_DIFFERENT will be, only that it won't match <code>a \d+</code>. I want to collect all consecutive instances of <code>\na \d+</code> that follow <code>HEADER\n</code>.</p>