title: Regular expression to match code blocks multiple times
body: <p>I want to match a block of code <em>multiple</em> times in a file but can't work out the regular expression to do this. An example of the code block is:</p>
  
  <pre><code>//@debug
  ...
  // code in here
  ...
  //@end-debug (possibly more comments here on same line)
  </code></pre>
  
  <p>Each code block I'm trying to match will start with <code>//@debug</code> and stop at the end of the line containing <code>//@end-debug</code></p>
  
  <p>I have this at the moment:</p>
  
  <pre><code>/(\/{2}\@debug)(.|\s)*(\/{2}\@end-debug).*/
  </code></pre>
  
  <p>But this matches one big block from the first <code>//@debug</code> all the way to end of the line of the very last <code>//@end-debug</code> in the file.</p>
  
  <p>Any ideas?</p>