Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(#([a-f\d]{3}){1,2}\b)|(rgb\((((\s*(0*?[0-2][0-5][0-5]|1\d{2}|\d{1,2})\s*,){2}\s*(0*?[0-2][0-5][0-5]|1\d{2}|\d{1,2}))|((\s*(0*?(100|\d{1,2})(\.\d+)?\%)\s*,){2}\s*(0*?(100|\d{1,2})(\.\d+)?\%)))\s*\))|(rgba\(\s*(((\s*(0*?[0-2][0-5][0-5]|1\d{2}|\d{1,2})\s*,){3}|(\s*(0*?(100|\d{1,2})(\.\d+)?\%)\s*,){3})(\s*0+(\.\d+)?\s*))\s*\))|(hsl\(\s*((0*?([0-3][0-6]0|\d{1,2}))\s*(,\s*(0*?(100|\d{1,2})(\.\d+)?\%)\s*){2})\))|(hsla\(\s*((0*?([0-3][0-6]0|\d{1,2}))\s*,(\s*(0*?(100|\d{1,2})(\.\d+)?\%)\s*,){2})\s*(0+(\.\d+)?)\s*\))
/
gmi
Unit Tests
There are no unit tests, click
here
to add some.