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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find UK Postcode
Expression
^(GIR\\s{0,1}0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\\s{0,1}[0-9][ABD-HJLNP-UW-Z]{2})$
Description
This regex have been created as per the information provided on http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm. This expression will allow the postcodes with space or without space.
Matches
GIR 0AA, GIR0AA, M1 1AA, EC1A 1BB
Non-Matches
E14 5LQH
Author Rating: Not yet rated. Debashish Saha
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

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