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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^[0-9]{4}\s{0,1}[a-zA-Z]{2}$
Description
Regular expression to evaluate dutch zipcodes. This is an updated version of Roland Mensenkamp.
Matches
2034AK | 2034 AK | 2034 ak
Non-Matches
2034 AK | 321321 AKSSAA
Author Rating: Not yet rated. Jon van Leuven
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: The term 'Dutch' is wrong!
Name: Oscar
Date: 8/31/2011 12:23:20 AM
Comment:
The term 'Dutch' is wrong! This is a postal code from The Netherlands, not 'Dutch'! 'Dutch' is NOT a country but a language which is spoken in different countries (with different forms of postal codes). As such, please do not use such a regexp if you know your users speak 'Dutch'. Their postal code might be quite different!


Title: Not strict enough
Name: Erik Terwiel
Date: 3/22/2011 8:34:41 AM
Comment:
This is too simple: letter combinations SS, SD and SA are not allowed for histiric reasons.


Title: Not strict enough
Name: Erik Terwiel
Date: 3/22/2011 8:34:08 AM
Comment:
This is too simple: letter combinations SS, SD and SA are not allowed for histiric reasons.


Title: Zipcode cannot start with zero
Name: Nic Scholten
Date: 9/9/2004 2:22:25 AM
Comment:
A Dutch zipcode cannot start with a zero


Title: RE
Name: Jon van Leuven
Date: 11/28/2003 4:41:07 AM
Comment:
Martijn, thanks for the update, good remark! MastaX, The 2034 AK should be 2034   AK (with more than one space) but this isn't visible in a html page, thats. So 2034 AK is a match and 2034   AK is no match.


Title: Could be better
Name: Martijn02
Date: 10/22/2003 10:48:24 AM
Comment:
MastaX, I think the 2034 AK in the non matches is 2034 AK with two spaces th parts. A better check should be ^[1-9][0-9]{3}\s{0,1}[a-zA-Z]{2}$ Because all zipcodes in the netherlands are above 1000


Title: Match?
Name: MastaX
Date: 5/25/2003 12:59:50 PM
Comment:
Sample Matches: 2034AK / 2034 AK / 2034 ak Sample Non-Matches: 2034 AK / 321321 AKSSAA you have 2034 AK in both, is it a match or not?


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