Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ItDriverLicenseRecognizer(PatternRecognizer):
"Driver License",
(
r"\b(?i)(([A-Z]{2}\d{7}[A-Z])"
r"|(^[U]1[BCDEFGHLJKMNPRSTUWYXZ0-9]{7}[A-Z]))\b"
r"|(U1[BCDEFGHLJKMNPRSTUWYXZ0-9]{7}[A-Z]))\b"
),
0.2,
),
Expand Down
4 changes: 4 additions & 0 deletions presidio-analyzer/tests/test_it_driver_license_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def entities() -> list[str]:
("U1H00A000B", 0, (), (),),
# Test with invalid Driver License
("990123456B", 0, (), (),),
# Test with JK letters in license (issue #1555)
("U1K711J11M", 1, ((0, 10),), ((0.1, 0.4),),),
# Test with JK letters not at start of string
("license U1K711J11M here", 1, ((8, 18),), ((0.1, 0.4),),),
# fmt: on
],
)
Expand Down
Loading