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
/
(?(DEFINE)(?'a'((eyr:20(2[0-9]|30))|(hcl:#[0-9a-f]{6})|(ecl:(amb|blu|brn|gry|grn|hzl|oth))|(hgt:(((59|6[0-9]|7[0-6])in)|((1[5-8][0-9]|19[0-3])cm)))|(iyr:20(1[0-9]|20))|(byr:(19[2-9][0-9]|200[0-2]))|(pid:\d{9})))(?'b'([ \n]|$)))((((?P>a)(?P>b)){7})|(((?P>a)|(cid:\d+))(?P>b)){8})(\n\n|$)
/
gm
Unit Tests
There are no unit tests, click
here
to add some.