Regular Expressions 101

Community Patterns

Simple CSS selectors

0

Regular Expression
ECMAScript (JavaScript)

/
[#.][-_]?[_a-zA-Z]+(?:\w|\\.)*|(?<=\s+|^)(?:\w+|\*)|\[[^\s"'=<>`]+?(?<![~|^$*])([~|^$*]?=(?:['"].*['"]|[^\s"'=<>`]+))?\]|:[\w-]+(?:\(.*\))?
/
gm

Description

Matches all types of CSS selectors

Submitted by anonymous - a year ago (Last modified a year ago)