Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-04-22 06:39
Flavor·ECMAScript (JavaScript)

/
^(.*?)(?:#(.*?))?(?:\.(.*))?$
/
gm
Open regex in editor

Description

Parse CSS Selector in the form element#id.class into its components. Any of the three elements can be missing.

Submitted by Mark