title: Regex to catch all cases
body: <p>I have the following stringified javascript-snippet that I would like to capture each case using regex</p>
  <pre><code>// case 1
  let something = 1
  something++
  
  // case 2
  const somethingElse = 2
  const x = somethingElse + 10 // whatever
  
  // case 3
  enter code here
  </code></pre>
  <p>Cases keep going infinitely.. so I am looking for a regex that captures each case with all belonging code up until the next case is reached.</p>
  <p>example of the first match should be</p>
  <pre><code>// case 1
  let something = 1
  something++
  </code></pre>
  <p>The best I could get is the following, but it always disregard the last case</p>
  <pre><code>([\/]{2}[\s]*?case[\s\S]+?(?=[\/]{2}))
  </code></pre>
  <p>Obviously, the Lookahead is the reason, I had other forms of regex but couldn't get a bulletproof regex..</p>
  <p>Note: all cases should be identified consistently. The example above is using a simple pattern <code>case [digit]</code></p>
  <p>Any help is appreciated!</p>