Skip to content

Commit 0aa9f8e

Browse files
Correct de_fuehrerschein docstring to match the actual pattern scope (#2138)
The class docstring gives "B0" (Berlin) as an example of a Behördenkürzel and lists `B012345678A` in the Examples line, but the regex `[A-Z]{2}\d{8}[A-Z0-9]` requires both leading characters to be letters, so `B012345678A` never matches. The test file's docstring is the authoritative one — it explicitly notes that single-letter Kfz codes are used in 2-letter authority forms (e.g. `BO`, `KN`) and that `B0`-style single-letter-plus-digit combinations are out of scope, and `test_when_all_de_fuehrerschein_numbers_then_succeed` asserts `B12345678A` is rejected. Update the class docstring to match the tests: replace the `"B0" Berlin` example with `"BO" Bochum`, add a short clarification about single-letter Kfz codes, and change the misleading `B012345678A` Examples entry to `BO12345678A`. Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
1 parent adc7c52 commit 0aa9f8e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

presidio-analyzer/presidio_analyzer/predefined_recognizers/country_specific/germany/de_fuehrerschein_recognizer.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ class DeFuehrerscheinRecognizer(PatternRecognizer):
1313
via FeV reform), the number follows a fixed 11-character structure:
1414
1515
Pos 1–2: Behördenkürzel – 2 uppercase letters identifying the issuing
16-
Fahrerlaubnisbehörde (derived from the Kfz-Zulassungskürzel of
17-
the issuing Kreis/Stadt, e.g. "B0" Berlin, "MU" München,
18-
"HH" Hamburg, "KO" Koblenz)
16+
Fahrerlaubnisbehörde (derived from the Kfz-Zulassungskürzel
17+
of the issuing Kreis/Stadt, e.g. "MU" München, "HH" Hamburg,
18+
"KO" Koblenz, "BO" Bochum). Single-letter Kfz codes such
19+
as "B" (Berlin) or "K" (Köln) are used in combination as
20+
2-letter authority codes here (e.g. "BO", "KN"); pure
21+
single-letter + digit forms like "B0" are out of scope for
22+
this strict pattern (see tests/test_de_fuehrerschein_recognizer.py).
1923
Pos 3–5: Behördennummer – 3-digit authority code within the Bundesland
2024
(assigned by the Kraftfahrt-Bundesamt, KBA)
2125
Pos 6–10: Laufende Nummer – 5-digit sequential issue number
@@ -27,7 +31,7 @@ class DeFuehrerscheinRecognizer(PatternRecognizer):
2731
EU standard: Annex I to Directive 2006/126/EC (Field 5).
2832
Data protection: DSGVO Art. 4 Nr. 1 (personenbezogene Daten), BDSG.
2933
30-
Examples (fictitious): B012345678A, MU12345678B, HH98765432C
34+
Examples (fictitious): BO12345678A, MU12345678B, HH98765432C
3135
3236
Scope note: Pre-2013 German driving licenses (pink folded card, laminated
3337
card) used locally defined, non-standardized number formats and remain

0 commit comments

Comments
 (0)