@@ -34,57 +34,57 @@ public DriversLicenseFilter(FilterConfiguration filterConfiguration) {
3434 // https://ntsi.com/drivers-license-format/
3535 // https://www.mvrdecoder.com/content/drvlicformats.aspx
3636
37- driversLicensePatterns .put ("ALABAMA" , Pattern .compile ("\\ b[0-9 ]{8}\\ b" )); // https://www.mvtrip.alabama.gov/News/ViewArticle/444
38- driversLicensePatterns .put ("ALASKA" , Pattern .compile ("\\ b[0-9 ]{7}\\ b" ));
39- driversLicensePatterns .put ("ARIZONA" , Pattern .compile ("\\ b([A-Z][0-9 ]{8})|([0-9 ]{9})\\ b" ));
40- driversLicensePatterns .put ("ARKANSAS" , Pattern .compile ("\\ b[9][0-9 ]{7}\\ b" ));
41- driversLicensePatterns .put ("CALIFORNIA" , Pattern .compile ("\\ b[A-Z][0-9 ]{7}\\ b" ));
42- driversLicensePatterns .put ("COLORADO" , Pattern .compile ("\\ b[0-9 ]{2}-[0-9 ]{3}[0-9 ]{4}\\ b" ));
43- driversLicensePatterns .put ("CONNECTICUT" , Pattern .compile ("\\ b[0-9 ]{9}\\ b" ));
44- driversLicensePatterns .put ("DELAWARE" , Pattern .compile ("\\ b[0-9 ]{7}\\ b" ));
45- driversLicensePatterns .put ("DISTRICT OF COLUMBIA" , Pattern .compile ("\\ b[0-9 ]{7}\\ b" ));
46- driversLicensePatterns .put ("FLORIDA" , Pattern .compile ("\\ b[A-Z][0-9 ]{3}-[0-9 ]{3}-[0-9 ]{2}-[0-9 ]{3}\\ b" ));
47- driversLicensePatterns .put ("GEORGIA" , Pattern .compile ("\\ b[0-9 ]{9}\\ b" ));
48- driversLicensePatterns .put ("HAWAII" , Pattern .compile ("\\ b[0-9 ]{8}\\ b" ));
49- driversLicensePatterns .put ("IDAHO" , Pattern .compile ("\\ b[A-Z]{2}[0-9 ]{6}[A-Z]\\ b" ));
50- driversLicensePatterns .put ("ILLINOIS" , Pattern .compile ("\\ b[A-Z][0-9 ]{11}\\ b" ));
51- driversLicensePatterns .put ("INDIANA" , Pattern .compile ("\\ b[0-9 ]{4}-[0-9 ]{2}-[0-9 ]{4}\\ b" ));
52- driversLicensePatterns .put ("IOWA" , Pattern .compile ("\\ b([0-9 ]{9})|[0-9 ]{3}[A-Z]{2}[0-9 ]{4}\\ b" ));
53- driversLicensePatterns .put ("KANSAS" , Pattern .compile ("\\ b[Kk][0-9 ]{2}-[0-9 ]{2}-[0-9 ]{4}\\ b" ));
54- driversLicensePatterns .put ("KENTUCKY" , Pattern .compile ("\\ b[A-Z][0-9 ]{2}-[0-9 ]{3}-[0-9 ]{3}\\ b" ));
55- driversLicensePatterns .put ("LOUISIANA" , Pattern .compile ("\\ b[00][0-9 ]{7}\\ b" ));
56- driversLicensePatterns .put ("MAINE" , Pattern .compile ("\\ b([0-9 ]{7})|[0-9 ]{7}[Xx]\\ b" ));
57- driversLicensePatterns .put ("MARYLAND" , Pattern .compile ("\\ b[A-Z]-[0-9 ]{3}-[0-9 ]{3}-[0-9 ]{3}-[0-9 ]{3}\\ b" ));
58- driversLicensePatterns .put ("MASSACHUSETTS" , Pattern .compile ("\\ b[Ss][1][0-9 ]{8}\\ b" ));
59- driversLicensePatterns .put ("MICHIGAN" , Pattern .compile ("\\ b[A-Z][0-9 ]{12}\\ b" ));
60- driversLicensePatterns .put ("MINNESOTA" , Pattern .compile ("\\ b[A-Z][0-9 ]{12}\\ b" ));
61- driversLicensePatterns .put ("MISSISSIPPI" , Pattern .compile ("\\ b[0-9 ]{9}\\ b" ));
62- driversLicensePatterns .put ("MISSOURI" , Pattern .compile ("\\ b([A-Z][0-9 ]{5,9})\\ b" ));
63- driversLicensePatterns .put ("MONTANA" , Pattern .compile ("\\ b[0-9 ]{13}\\ b" ));
64- driversLicensePatterns .put ("NEBRASKA" , Pattern .compile ("\\ b[A-Z][0-9 ]{3,8}\\ b" ));
65- driversLicensePatterns .put ("NEVADA" , Pattern .compile ("\\ b[0-9 ]{10}\\ b" ));
66- driversLicensePatterns .put ("NEW HAMPSHIRE" , Pattern .compile ("\\ b[0-9 ]{2}[A-Z]{3}[0-9 ]{5}\\ b" ));
67- driversLicensePatterns .put ("NEW JERSEY" , Pattern .compile ("\\ b[A-Z][0-9 ]{4}-[0-9 ]{5}-[0-9 ]{5}\\ b" ));
68- driversLicensePatterns .put ("NEW MEXICO" , Pattern .compile ("\\ b[0-9 ]{9}\\ b" ));
69- driversLicensePatterns .put ("NEW YORK" , Pattern .compile ("\\ b([0-9 ]{9})|([0-9 ]{3}-0-9 ]{3}-0-9 ]{3})\\ b" ));
70- driversLicensePatterns .put ("NORTH CAROLINA" , Pattern .compile ("\\ b[0-9 ]{8,12}\\ b" ));
71- driversLicensePatterns .put ("NORTH DAKOTA" , Pattern .compile ("\\ b([A-Z]{3}[0-9 ]{6})|([A-Z]{3}-[0-9 ]{2}-[0-9 ]{4})\\ b" ));
72- driversLicensePatterns .put ("OHIO" , Pattern .compile ("\\ b[A-Z]{2}[0-9 }{6}]\\ b" ));
73- driversLicensePatterns .put ("OKLAHOMA" , Pattern .compile ("\\ b([A-Z][0-9 ]{8})|([A-Z][0-9 ]{9})\\ b" ));
74- driversLicensePatterns .put ("OREGON" , Pattern .compile ("\\ b[0-9 ]{7}\\ b" ));
75- driversLicensePatterns .put ("PENNSYLVANIA" , Pattern .compile ("\\ b([0-9 ]{8})|([0-9 ]{2}[ ][0-9 ]{3}[ ][0-9 ]{3})\\ b" ));
76- driversLicensePatterns .put ("RHODE ISLAND" , Pattern .compile ("\\ b[0-9 ]{7}\\ b" ));
77- driversLicensePatterns .put ("SOUTH CAROLINA" , Pattern .compile ("\\ b[0-9 ]{9}\\ b" ));
78- driversLicensePatterns .put ("SOUTH DAKOTA" , Pattern .compile ("\\ b[0-9 ]{8}\\ b" ));
79- driversLicensePatterns .put ("TENNESSEE" , Pattern .compile ("\\ b[0-9 ]{8,9}\\ b" ));
80- driversLicensePatterns .put ("TEXAS" , Pattern .compile ("\\ b[0-9 ]{8}\\ b" ));
81- driversLicensePatterns .put ("UTAH" , Pattern .compile ("\\ b[0-9 ]{4,10}\\ b" ));
82- driversLicensePatterns .put ("VERMONT" , Pattern .compile ("\\ b([0-9 ]{8})|([0-9 ]{7}[A-Z])\\ b" ));
83- driversLicensePatterns .put ("VIRGINIA" , Pattern .compile ("\\ b[A-Z][0-9 ]{2}-[0-9 ]{2}-[0-9 ]{4}\\ b" ));
84- driversLicensePatterns .put ("WASHINGTON" , Pattern .compile ("\\ b[A-Z0-9 ]{12}\\ b" ));
85- driversLicensePatterns .put ("WEST VIRGINIA" , Pattern .compile ("\\ b([0-9 ]{7})|([A-Z][0-9 ]{6})\\ b" ));
86- driversLicensePatterns .put ("WISCONSIN" , Pattern .compile ("\\ b[A-Z][0-9 ]{13}\\ b" ));
87- driversLicensePatterns .put ("WYOMING" , Pattern .compile ("\\ b([0-9 ]{9})|([0-9 ]{6}-[0-9 ]{3})\\ b" ));
37+ driversLicensePatterns .put ("ALABAMA" , Pattern .compile ("\\ b[\\ d ]{8}\\ b" )); // https://www.mvtrip.alabama.gov/News/ViewArticle/444
38+ driversLicensePatterns .put ("ALASKA" , Pattern .compile ("\\ b[\\ d ]{7}\\ b" ));
39+ driversLicensePatterns .put ("ARIZONA" , Pattern .compile ("\\ b([A-Z][\\ d ]{8})|([\\ d ]{9})\\ b" ));
40+ driversLicensePatterns .put ("ARKANSAS" , Pattern .compile ("\\ b[9][\\ d ]{7}\\ b" ));
41+ driversLicensePatterns .put ("CALIFORNIA" , Pattern .compile ("\\ b[A-Z][\\ d ]{7}\\ b" ));
42+ driversLicensePatterns .put ("COLORADO" , Pattern .compile ("\\ b[\\ d ]{2}-[\\ d ]{3}[\\ d ]{4}\\ b" ));
43+ driversLicensePatterns .put ("CONNECTICUT" , Pattern .compile ("\\ b[\\ d ]{9}\\ b" ));
44+ driversLicensePatterns .put ("DELAWARE" , Pattern .compile ("\\ b[\\ d ]{7}\\ b" ));
45+ driversLicensePatterns .put ("DISTRICT OF COLUMBIA" , Pattern .compile ("\\ b[\\ d ]{7}\\ b" ));
46+ driversLicensePatterns .put ("FLORIDA" , Pattern .compile ("\\ b[A-Z][\\ d ]{3}-[\\ d ]{3}-[\\ d ]{2}-[\\ d ]{3}\\ b" ));
47+ driversLicensePatterns .put ("GEORGIA" , Pattern .compile ("\\ b[\\ d ]{9}\\ b" ));
48+ driversLicensePatterns .put ("HAWAII" , Pattern .compile ("\\ b[\\ d ]{8}\\ b" ));
49+ driversLicensePatterns .put ("IDAHO" , Pattern .compile ("\\ b[A-Z]{2}[\\ d ]{6}[A-Z]\\ b" ));
50+ driversLicensePatterns .put ("ILLINOIS" , Pattern .compile ("\\ b[A-Z][\\ d ]{11}\\ b" ));
51+ driversLicensePatterns .put ("INDIANA" , Pattern .compile ("\\ b[\\ d ]{4}-[\\ d ]{2}-[\\ d ]{4}\\ b" ));
52+ driversLicensePatterns .put ("IOWA" , Pattern .compile ("\\ b([\\ d ]{9})|[\\ d ]{3}[A-Z]{2}[\\ d ]{4}\\ b" ));
53+ driversLicensePatterns .put ("KANSAS" , Pattern .compile ("\\ b[Kk][\\ d ]{2}-[\\ d ]{2}-[\\ d ]{4}\\ b" ));
54+ driversLicensePatterns .put ("KENTUCKY" , Pattern .compile ("\\ b[A-Z][\\ d ]{2}-[\\ d ]{3}-[\\ d ]{3}\\ b" ));
55+ driversLicensePatterns .put ("LOUISIANA" , Pattern .compile ("\\ b[00][\\ d ]{7}\\ b" ));
56+ driversLicensePatterns .put ("MAINE" , Pattern .compile ("\\ b([\\ d ]{7})|[\\ d ]{7}[Xx]\\ b" ));
57+ driversLicensePatterns .put ("MARYLAND" , Pattern .compile ("\\ b[A-Z]-[\\ d ]{3}-[\\ d ]{3}-[\\ d ]{3}-[\\ d ]{3}\\ b" ));
58+ driversLicensePatterns .put ("MASSACHUSETTS" , Pattern .compile ("\\ b[Ss][1][\\ d ]{8}\\ b" ));
59+ driversLicensePatterns .put ("MICHIGAN" , Pattern .compile ("\\ b[A-Z][\\ d ]{12}\\ b" ));
60+ driversLicensePatterns .put ("MINNESOTA" , Pattern .compile ("\\ b[A-Z][\\ d ]{12}\\ b" ));
61+ driversLicensePatterns .put ("MISSISSIPPI" , Pattern .compile ("\\ b[\\ d ]{9}\\ b" ));
62+ driversLicensePatterns .put ("MISSOURI" , Pattern .compile ("\\ b([A-Z][\\ d ]{5,9})\\ b" ));
63+ driversLicensePatterns .put ("MONTANA" , Pattern .compile ("\\ b[\\ d ]{13}\\ b" ));
64+ driversLicensePatterns .put ("NEBRASKA" , Pattern .compile ("\\ b[A-Z][\\ d ]{3,8}\\ b" ));
65+ driversLicensePatterns .put ("NEVADA" , Pattern .compile ("\\ b[\\ d ]{10}\\ b" ));
66+ driversLicensePatterns .put ("NEW HAMPSHIRE" , Pattern .compile ("\\ b[\\ d ]{2}[A-Z]{3}[\\ d ]{5}\\ b" ));
67+ driversLicensePatterns .put ("NEW JERSEY" , Pattern .compile ("\\ b[A-Z][\\ d ]{4}-[\\ d ]{5}-[\\ d ]{5}\\ b" ));
68+ driversLicensePatterns .put ("NEW MEXICO" , Pattern .compile ("\\ b[\\ d ]{9}\\ b" ));
69+ driversLicensePatterns .put ("NEW YORK" , Pattern .compile ("\\ b([\\ d ]{9})|([\\ d ]{3}-\\ d ]{3}-\\ d ]{3})\\ b" ));
70+ driversLicensePatterns .put ("NORTH CAROLINA" , Pattern .compile ("\\ b[\\ d ]{8,12}\\ b" ));
71+ driversLicensePatterns .put ("NORTH DAKOTA" , Pattern .compile ("\\ b([A-Z]{3}[\\ d ]{6})|([A-Z]{3}-[\\ d ]{2}-[\\ d ]{4})\\ b" ));
72+ driversLicensePatterns .put ("OHIO" , Pattern .compile ("\\ b[A-Z]{2}[\\ d }{6}]\\ b" ));
73+ driversLicensePatterns .put ("OKLAHOMA" , Pattern .compile ("\\ b([A-Z][\\ d ]{8})|([A-Z][\\ d ]{9})\\ b" ));
74+ driversLicensePatterns .put ("OREGON" , Pattern .compile ("\\ b[\\ d ]{7}\\ b" ));
75+ driversLicensePatterns .put ("PENNSYLVANIA" , Pattern .compile ("\\ b([\\ d ]{8})|([\\ d ]{2}[ ][\\ d ]{3}[ ][\\ d ]{3})\\ b" ));
76+ driversLicensePatterns .put ("RHODE ISLAND" , Pattern .compile ("\\ b[\\ d ]{7}\\ b" ));
77+ driversLicensePatterns .put ("SOUTH CAROLINA" , Pattern .compile ("\\ b[\\ d ]{9}\\ b" ));
78+ driversLicensePatterns .put ("SOUTH DAKOTA" , Pattern .compile ("\\ b[\\ d ]{8}\\ b" ));
79+ driversLicensePatterns .put ("TENNESSEE" , Pattern .compile ("\\ b[\\ d ]{8,9}\\ b" ));
80+ driversLicensePatterns .put ("TEXAS" , Pattern .compile ("\\ b[\\ d ]{8}\\ b" ));
81+ driversLicensePatterns .put ("UTAH" , Pattern .compile ("\\ b[\\ d ]{4,10}\\ b" ));
82+ driversLicensePatterns .put ("VERMONT" , Pattern .compile ("\\ b([\\ d ]{8})|([\\ d ]{7}[A-Z])\\ b" ));
83+ driversLicensePatterns .put ("VIRGINIA" , Pattern .compile ("\\ b[A-Z][\\ d ]{2}-[\\ d ]{2}-[\\ d ]{4}\\ b" ));
84+ driversLicensePatterns .put ("WASHINGTON" , Pattern .compile ("\\ b[A-Z \\ d ]{12}\\ b" ));
85+ driversLicensePatterns .put ("WEST VIRGINIA" , Pattern .compile ("\\ b([\\ d ]{7})|([A-Z][\\ d ]{6})\\ b" ));
86+ driversLicensePatterns .put ("WISCONSIN" , Pattern .compile ("\\ b[A-Z][\\ d ]{13}\\ b" ));
87+ driversLicensePatterns .put ("WYOMING" , Pattern .compile ("\\ b([\\ d ]{9})|([\\ d ]{6}-[\\ d ]{3})\\ b" ));
8888
8989 this .contextualTerms = new HashSet <>();
9090 this .contextualTerms .add ("license" );
0 commit comments