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:
@media (max-width: 1200px) { .container { padding-left: 0px; } .bundles {padding-right:10px} }
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:
[".container { padding-left: 0px; }", ".bundles {padding-right:10px}"]
This is my attempt:
var identifiers = mediaQuery.match(/\.(.*)}/);
I was under the assumption match
would give me all matches. However I am only getting one match, so I must be doing something wrong.