Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(.*?)(?:#(.*?))?(?:\.(.*))?$
/
gm

Description

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

Submitted by Mark - 3 years ago