title: Regex to get all possible matches for a pattern in C#
body: <p>I'm learning regex and need to get all possible matches for a pattern out of a string.</p>
  
  <p>If my input is:</p>
  
  <pre><code>case a
  when cond1 
  then stmt1;
  when cond2 
  then stmt2;
  end case;
  </code></pre>
  
  <p>I need to get the matches which have groups as follows</p>
  
  <p>Group1:</p>
  
  <ol>
  <li><code>"cond1"</code></li>
  <li><code>"stmt1;"</code></li>
  </ol>
  
  <p>and Group2:</p>
  
  <ol>
  <li><code>"cond2"</code></li>
  <li><code>"stmt2;"</code></li>
  </ol>
  
  <p>Is it possible to get such groups using any regex?</p>