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
JS Parse rgb or rgba CSS string
Open Workspace
PCRE2 (PHP)
Match
Created 2021-06-05 11:01
0
Regular Expression
/
rgba
?
\(
\s
*
(
25
[
0
-
5
]
|
2
[
0
-
4
]
\d
|
1
\d
{1,2}
|
\d\d
?
)
\s
*
,
\s
*
(
25
[
0
-
5
]
|
2
[
0
-
4
]
\d
|
1
\d
{1,2}
|
\d\d
?
)
\s
*
,
\s
*
(
25
[
0
-
5
]
|
2
[
0
-
4
]
\d
|
1
\d
{1,2}
|
\d\d
?
)
\s
*
,
?
\s
*
(
[
01
\.
]
\.
?
\d
?
)?
\s
*
\)
/
gm
Description
This will parse and give you the values of an RGB or RGBA CSS style.
Submitted by
Beau Beauchamp, WebTIGERS