title: Multiple Occurrences of a Pattern in Python
body: <p>I'm new to python and I'm trying to construct a list of tuples with the start and end indices for pattern matching in a string.</p>
  
  <p>I need to match a pattern that starts with 2 consecutive 0s and ends with 2 consecutive 1s with some combo of 0s and 1s in between.</p>
  
  <p>For example, </p>
  
  <pre><code>s = '00101010111111100001011'
  </code></pre>
  
  <p>With some type of operation returning,</p>
  
  <pre><code>[(0, 10), (15, 23)]
  </code></pre>
  
  <p>I can find multiple occurrences of a pattern in a string using,</p>
  
  <pre><code>ind = [(m.start(), m.end()) for m in re.finditer(pattern, s)]
  </code></pre>
  
  <p>I'm just not sure how to write the regular expression (i.e pattern) to output what I want.</p>