title: Regex to grab strings between square brackets
body: <p>I have the following string: <code>pass[1][2011-08-21][total_passes]</code></p>
  
  <p>How would I extract the items between the square brackets into an array? I tried </p>
  
  <p><code>match(/\[(.*?)\]/);</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var s = 'pass[1][2011-08-21][total_passes]';
  var result = s.match(/\[(.*?)\]/);
  
  console.log(result);</code></pre>
  </div>
  </div>
  </p>
  
  <p>but this only returns <code>[1]</code>.</p>
  
  <p>Not sure how to do this.. Thanks in advance.</p>