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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Pattern Title
Expression
\b((?:0[1-46-9]\d{3})|(?:[1-357-9]\d{4})|(?:[4][0-24-9]\d{3})|(?:[6][013-9]\d{3}))\b
Description
This is my attempt to find out valid german postal codes (PLZ or Postleitzahlen). After the German Unification the numbers were changed to a five digit system. The postal codes starts with the two digit "Leitzahl". This is a number between 00 and 99 excluding the not yet used numbers: 00, 05, 43 and 62! After that follows directly a three digit number, 000-999. Comments welcome. This works for me, however I think it could be written more compact, but could not figure out how ;-) For more information on german postal codes see: http://de.wikipedia.org/wiki/Liste_der_Postleitbereiche_Deutschland http://de.wikipedia.org/wiki/Postleitzahl_%28Deutschland%29 http://en.wikipedia.org/wiki/List_of_postal_codes_in_Germany
Matches
12556 | 01550 | 80796
Non-Matches
05234 | 8973 | 62980
Author Rating: The rating for this expression. Markus Matern
   Displaying page 1 of 1 pages; Items 1 to 1

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