Got Pseudocode for UK Field Rules?

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Got Pseudocode for UK Field Rules?

Post by volomike »

Anyone have any pseudocode (regexps would be even cooler) for UK fields? In particular I am interested in:

Address Line 1
Home Phone
Mobile Phone (do they have a special prefix?)
Post Code

I only know the ones for the USA.
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: Got Pseudocode for UK Field Rules?

Post by volomike »

I found the answer on Stack Overflow:

http://www.braemoor.co.uk/software/postcodes.shtml

In the margin, it answers not only UK post codes, but UK phone numbers too. If you see a problem with the PHP source on this, please do let me know because I'm going to run with this.
User avatar
prometheuzz
Forum Regular
Posts: 779
Joined: Fri Apr 04, 2008 5:51 am

Re: Got Pseudocode for UK Field Rules?

Post by prometheuzz »

volomike wrote:Anyone have any pseudocode (regexps would be even cooler) for UK fields? In particular I am interested in:

Address Line 1
Home Phone
Mobile Phone (do they have a special prefix?)
Post Code

I only know the ones for the USA.
Phone numbers in the UK (also mobile phones):
http://en.wikipedia.org/wiki/Telephone_ ... ed_Kingdom

Postal codes in the UK (ZIP codes):
http://en.wikipedia.org/wiki/UK_postcodes

And addresses are as good as impossible to validate. Seriously.
Post Reply