title: RegEx to find inner content of [code] tags
body: <p>If I have a string value of something like this:</p>
  
  <pre><code>[code]
  hi
  [/code]
  </code></pre>
  
  <p>I can use this regex to get the tag and the middle content:</p>
  
  <pre><code>/(?:(\[code\]))([\s\S]*)(?:(\[\/code\]))/gi
  </code></pre>
  
  <p>But if I have a string value with multiple [code] tag sets then it returns as a single match instead of multiple:</p>
  
  <pre><code>[code]
  hi
  [/code]
  
  [code]
  hello
  [/code]
  </code></pre>
  
  <p>I'm running the RegEx through a text.replace to parse the middle content something like:</p>
  
  <pre><code>text.replace(re, function(match, open_tag, middle, close_tag) {
      //do stuff here
      return open_tag + middle + close_tag;
  });
  </code></pre>
  
  <p>But like I said, it's not being that there is two separate code sets, only as a single and that's likely my use of <code>\S</code> matching everything. How do I parse this properly?</p>
  
  <p>quick jsfiddle: <a href="http://jsfiddle.net/rutsk28L/" rel="nofollow">http://jsfiddle.net/rutsk28L/</a></p>