Regular Expressions 101

Simple CSS selectors

Open Workspace
  • JavaScript
  • Match
0

Regular Expression

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

Description

Matches all types of CSS selectors

Submitted by Anonymous