Regular Expressions 101

Sponsors

Library entries

3
javascript

mm/dd/yyyy Date

no description available
Submitted by jay johnson - 9 years ago
3
python

date time

1/Jul/2013 03:27:12
Submitted by himel - 9 years ago
3
javascript

po box

no description available
Submitted by anonymous - 8 years ago
3
javascript

javascript template replacement

no description available
Submitted by akamaozu - 8 years ago
3
javascript

TEST

negation
Submitted by anonymous - 8 years ago
3
javascript

Simple math regex

no description available
Submitted by anonymous - 8 years ago
3
python

phone

matches: + example: +52 33 3884 7720 +1 770 343 5788
Submitted by miqui - 7 years ago
3
python

prices in nis

no description available
Submitted by molaxx - 7 years ago
3
javascript

Italian VAT (IVA)

Italian VAT
Submitted by Italo - 7 years ago

html color match: transparent, #fff, #123456, rgb, rgba, hsl, hsla

Vote

11

Regular Expression
javascript

/
^(rgb\s*?\(\s*?(000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\s*?,\s*?(000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\s*?,\s*?(000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\s*?\))$|^(rgba\s*?\(\s*?(000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\s*?,\s*?(000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\s*?,\s*?(000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\s*?,\s*?(0|0\.\d*|1|1.0*)\s*?\))$|^(transparent)$|^(#([a-fA-F0-9]){3})$|^(#([a-fA-F0-9]){6}$)|(^hsl\s*?\(\s*?(000|0?\d{1,2}|[1-2]\d\d|3[0-5]\d|360)\s*?,\s*?(000|100|0?\d{2}|0?0?\d)%\s*?,\s*?(000|100|0?\d{2}|0?0?\d)%\s*?\)$)|(^hsla\s*?\(\s*?(000|0?\d{1,2}|[1-2]\d\d|3[0-5]\d|360)\s*?,\s*?(000|100|0?\d{2}|0?0?\d)%\s*?,\s*?(000|100|0?\d{2}|0?0?\d)%\s*?,\s*?(0|0\.\d*|1|1.0*)\s*?\)$)$
/

Description

Loading markdown...
Submitted by grouch - 8 years ago