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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(^(((GIR)\s{0,1}((0AA))))|(([A-PR-UWYZ][0-9][0-9]?)|([A-PR-UWYZ][A-HK-Y][0-9][0-9]?)|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s{0,1}([0-9][ABD-HJLNP-UW-Z]{2})$)
Description
United Kingdom Postcode expression, modified for use with Microsoft.Net regular expression validations. ( see http://www.govtalk.gov.uk/gdsc/html/frames/PostCode.htm and http://www.govtalk.gov.uk/gdsc/schemas/bs7666-v2-0.xsd )
Matches
GIR 0AA | EC4N 4SA | S25 2XT
Non-Matches
GIR 0AB | QC4C 4SV | Q25 2XT
Author Rating: Not yet rated. Paul Stinton
Source Modified from the UK Government Data Standards Catalogue xsd for use with Microsoft .Net regular expression validators
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: United Kingdom Postcode expression
Name: Paul Stinton
Date: 11/13/2005 8:13:02 AM
Comment:
Industrial strength UK Postcode expression for Microsoft .Net regular expression validator


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