RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find German License Plate
Expression
^[A-ZÄÖÜ]{1,3}\-[ ]{0,1}[A-Z]{0,2}[0-9]{1,4}[H]{0,1}
Description
This one checks if the value is a possible german License Plate. The trailing H stands for Historical cars.
Matches
F-RM373, WÜ-Z1, K- 07333,HN-WK11H
Non-Matches
MOS-AS
Author Rating: Not yet rated. Kemmeter
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Example with 5 number not really matched
Name: J
Date: 1/5/2023 2:31:56 PM
Comment:
Your example "K- 07333" is a match with the regex, but only for the first 4 numbers, not the last '3'. The regex should be fixed to [0-9]{1,5} (instead of [0-9]{1,4}), if german number plates indeed can have 5 digits. The regex should also finish with '$' to ensure that it matches the entire string and not just the first characters.


Title: Example with 5 number not really matched
Name: J
Date: 1/5/2023 2:31:43 PM
Comment:
Your example "K- 07333" is a match with the regex, but only for the first 4 numbers, not the last '3'. The regex should be fixed to [0-9]{1,5} (instead of [0-9]{1,4}), if german number plates indeed can have 5 digits. The regex should also finish with '$' to ensure that it matches the entire string and not just the first characters.


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials