Regular Expressions 101

Sponsors

Library entries

0
pcre2

Picking 2nd 1st Line

Picking 2nd 1st Line
Submitted by Picking 2nd 1st Line - 10 days ago
0
pcre2

Picking 1st Line

Picking 1st Line
Submitted by Picking 1st Line - 10 days ago
0
pcre2

City State Zip

City State Zip
Submitted by anonymous - 10 days ago
1
pcre2

ticker but not EFS

ticker but not EFS
Submitted by anonymous - 11 days ago

Valid RGB color value

Vote

1

Regular Expression
javascript

/
^rgba?\((?:\s+)?(?<r>\d+(?<unit>%?))(?:\s+)?(?<separator>[\s|,])(?:\s+)?(?<g>\d+\k<unit>)(?:\s+)?\k<separator>(?:\s+)?(?<b>\d+\k<unit>)(?:\s+)?(?:(?<=(?:,.+))(?:,(?:\s+)?(?<a>(?:\d+)?(?:\.?\d+)))?(?:\s+)?)?\)$
/
gm

Description

Loading markdown...
Submitted by BorisTB - 4 months ago