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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find SIMPLE UK POST CODE
Expression
([a-zA-Z]{2}[0-9]{1,2}\s{0,1}[0-9]{1,2}[a-zA-Z]{2})
Description
This is a simple post code regex for UK. It does a wonderfull job.
Matches
GL50 4ED | GL504ED | gl504ed | gl50 4ed | GL5 4ED | GL5 43ED
Non-Matches
1323 | 3ws23
Author Rating: Not yet rated. zan kavtaskin
Source Zan Kavtaskin
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: A slight improvement...
Name: John
Date: 2/10/2011 4:42:39 AM
Comment:
...to handle more postcodes, like those with only one letter, and london postcodes in the format W1C 5EA. ([a-zA-Z]{1,2}[0-9]{1,2}[a-zA-Z]{0,1}\s{0,1}[0-9]{1,2}[a-zA-Z]{2})


Title: A slight improvement...
Name: John
Date: 2/10/2011 4:38:07 AM
Comment:
...to handle more postcodes, like those with only one letter, and london postcodes in the format W1C 5EA. ([a-zA-Z]{1,2}[0-9]{1,2}[a-zA-Z]{0,1}\s{0,1}[0-9]{1,2}[a-zA-Z]{2})


Title: A slight improvement...
Name: John
Date: 2/10/2011 4:37:59 AM
Comment:
...to handle more postcodes, like those with only one letter, and london postcodes in the format W1C 5EA. ([a-zA-Z]{1,2}[0-9]{1,2}[a-zA-Z]{0,1}\s{0,1}[0-9]{1,2}[a-zA-Z]{2})


Title: Needs work
Name: Adam
Date: 3/2/2010 9:48:54 AM
Comment:
Didn't work with W2 1LA


Title: Needs work
Name: Adam
Date: 3/2/2010 9:48:47 AM
Comment:
Didn't work with W2 1LA


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