title: Can i group a text file with Regex based on line patterns
body: <p>Given a file:</p>
  
  <pre><code>Timestamp: some text and a number 1
  Timestamp: some text and a number 33
  Timestamp: some text and a number 1
  Timestamp: some text and a number 22
  Something totally different, maybe a new pattern
  Timestamp: some text and a number 4
  Timestamp: some text and a number 2
  Something totally different, maybe a new pattern
  Something totally different, maybe a new pattern
  </code></pre>
  
  <p>I would like to get groupings of line 1 to 4(TYPE1) and line 5(TYPE2), line 6,7(TYPE1) and line 8,9(TYPE2).</p>
  
  <p>Can this be done in one regualar expression or should i create one expression for each type and then check line by line and if the previous line is the same type?</p>
  
  <p>At the end i need to return a list of groupings with pair(int start_char, int end_char)</p>