Regular Expressions 101

Community Library Entry

2

Regular Expression
ECMAScript (JavaScript)

/
(@.*?:[^}{@]+(\{(?:[^}{]+|\{(?:[^}{]+|\{[^}{]*\})*\})*\}))
/
g

Description

Matches a CSS @media selector, matches outer {} curly brackets, works with every CSS code, minified too.

Submitted by emd4 - 8 years ago