Postcodes

Jun. 13th, 2012 08:44 pm
sobrique: (Default)
[personal profile] sobrique
Dear everyone who uses post codes on your website.
Would you kindly refrain from insisting my post code is incorrect if it doesn't include a space.
It's not rocket science to parse post codes.
They are
a) not case sensitive.
b) The second part is ALWAYS a digit, and two letters.
c) the 'first part' is ALWAYS two letters, and 1 or 2 digits.

(The first part is also geographically grouped, but the second part may not be.

So there's no ambiguity involved - you can't get 'mixed up' between AB1 23CD and AB12 3CD, AB123CD, ab123CD. They're all the same post code. (And it's region 'AB12').
Not being able to parse this on your website is just sloppy - at least, bearing in mind you're doing any validation whatsoever on your inputs. (Which you are, because you've spotted it hasn't got a space).

Date: 2012-06-13 07:56 pm (UTC)
From: [identity profile] xarrion.livejournal.com
c) Except for central London, which is cardinal points N, S, E, W and one or two numbers. So N1 is not the same as N12

Date: 2012-06-13 08:00 pm (UTC)
From: [identity profile] sobrique.livejournal.com
OK. 1-2 letters, 1-2 digits.
But the last part is still 3. So picking them out is as easy as length -3.

Date: 2012-06-13 09:02 pm (UTC)
From: [identity profile] ehrine.livejournal.com
You're right that the last part is always 1 digit, 2 letters, but the first doesn't have to be 1-2 letters then 1-2 numbers. London has some freaky things like W1C 2HA. They ran out of numbers in the first bit :)

Date: 2012-06-14 10:18 pm (UTC)
fearmeforiampink: (Nick)
From: [personal profile] fearmeforiampink
Aye. I live in WC1N, and occasionally get websites telling me my postcode doesn't exist, because they're using something like [livejournal.com profile] sobrique's list of rules

Date: 2012-06-14 03:25 am (UTC)
From: [identity profile] erjholton.livejournal.com
Considering there's even a British Standard that covers validation, and Wikipedia even gives example regexes (http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation), it seems a bit shoddy.

Profile

sobrique: (Default)
sobrique

December 2015

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728 293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 18th, 2026 11:21 pm
Powered by Dreamwidth Studios