Regular Expressions 101

Community Patterns

MRZ Line 2

1

Regular Expression
PCRE (PHP <7.3)

/
(?<pnum>[\dA-Z]{9}).(?<nat>\w{3})(?<yob>\d{2})(?<mob>\d{2})(?<dob>\d{2}).(?<sex>M|F|<{1})(?<yoe>\d{2})(?<moe>\d{2})(?<doe>\d{2}).(?<prnum>[]\d|<A-Z]{16})
/

Description

Machine readable passport rule for the second line

Submitted by Igor Ferreira - 8 years ago