Regular Expressions 101

Css Splitter

Open Workspace
  • PCRE (Legacy)
  • Unit Tests
1

Regular Expression

/
(\/\*[\s\S]*?\*\/|[^}{;\/]+\{[^{}]*\}|;|}|[^}{;\*]+\{)
/
g

Description

Splits the css code into two blocks. (comments|selector block)

Submitted by @Silent_Coder