title: JavaScript regex get all matches in a string
body: <p>I want to get an array of matches within a string. Currently, my string is a media query. I removed all new lines in the media query, so one media query might look like this:</p>
  
  <pre><code>@media (max-width: 1200px) { .container { padding-left: 0px; } .bundles {padding-right:10px} }
  </code></pre>
  
  <p>What I want to do is get all the classes from the media query including their style attributes. So I would like an array that look as follows:</p>
  
  <pre><code>[".container { padding-left: 0px; }", ".bundles {padding-right:10px}"]
  </code></pre>
  
  <p>This is my attempt:</p>
  
  <pre><code>var identifiers = mediaQuery.match(/\.(.*)}/);
  </code></pre>
  
  <p>I was under the assumption <code>match</code> would give me all matches. However I am only getting one match, so I must be doing something wrong.</p>