Regular Expressions 101

Community Patterns

German vehicle registration incl. options

1

Regular Expression
PCRE (PHP <7.3)

/
^([A-ZäÄÖÜ]{1,3})\-[ ]{0,1}([A-Z]{0,2})[ ]{0,1}([0-9]{1,4}[HE]{0,1})[ ]{0,1}([0-9]{0,2})[ ]{0,1}([0-9]{0,2})$
/
gm

Description

  • This regex validates German vehicle registration numbers. It includes 'H' for Oldtimers (Historic) and 'E' for electric. Futhermore it validates optional seasonal plates. For example for motorcycles or recreational vehicles.
Submitted by awwillia - 3 years ago