Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
Simple CSS selectors
Open Workspace
JavaScript
Match
Created 2023-01-27 08:55
0
Regular Expression
/
[
#.
]
[
-_
]
?
[
_a
-
zA
-
Z
]
+
(?:
\w
|
\\
.
)*
|
(?<=
\s
+
|
^
)(?:
\w
+
|
\*
)
|
\[
[^
\s
"'=<>`
]
+?
(?<!
[
~|^$*
]
)(
[
~|^$*
]
?
=
(?:
[
'"
]
.
*
[
'"
]
|
[^
\s
"'=<>`
]
+
)
)?
\]
|
:
[
\w
-
]
+
(?:
\(
.
*
\)
)?
/
gm
Description
Matches all types of CSS selectors
Submitted by
Anonymous