Title |
Test
Find
UK Postcode District
|
Expression |
([A-PR-UWYZa-pr-uwyz]([0-9]{1,2}|([A-HK-Ya-hk-y][0-9]|[A-HK-Ya-hk-y][0-9]([0-9]|[ABEHMNPRV-Yabehmnprv-y]))|[0-9][A-HJKS-UWa-hjks-uw])) |
Description |
Matches the first part of a UK Postcode (known as a postcode district).
Case insensitive.
Doesnt match:
GIR # the postcode for the formerly Post Office-owned Girobank is GIR 0AA.
SAN # the postcode for correctly addressed letters to Father Christmas is SAN TA1 |
Matches |
LN5 | SW1 | ln5 |
Non-Matches |
ln5 7nq | GIR | SAN |
Author |
Rating:
Matthew Harris
|
Source |
http://chillisource.blogspot.com/2008/03/regex-for-uk-postcode.html |
Your Rating |
|
Title: Request
Name: Hattensh
Date: 1/9/2012 3:54:26 AM
Comment:
Hi I am trying to validate the first part of the postcode e.g. LS12 this regex seems to only work for LS1, BD5 etc
Title: Request
Name: Hattensh
Date: 1/9/2012 3:54:20 AM
Comment:
Hi I am trying to validate the first part of the postcode e.g. LS12 this regex seems to only work for LS1, BD5 etc