Regular Expressions 101

Community Library

Community Library Entry

1

Regular ExpressionOpen Workspace

/
\{\n\s+(.+)\n(\s+}|})
/
gm

Description
Created·2026-03-01 16:22
Updated·2026-03-01 17:35
Type·Substitution
Flavor·PCRE2 (PHP)

Finds CSS selectors that only contain one line and, using the substitution, flattens everything to be on the same line.

Submitted by Anonymous
Open Workspace