Questions tagged [postal-code]

A postal code is a series of letters and/or digits which is useful to identify the a particular region within a postal address. Once postal codes were introduced, other applications became possible.

A postal code is a series of letters and/or digits which is useful to identify the a particular region within a postal address. Once postal codes were introduced, other applications became possible.

In February 2005, 117 of the 190 member countries of the Universal Postal Union had postal code systems. Countries that do not have national systems include Ireland and Panama. Although Hong Kong and Macau are now Special Administrative Regions of China, each maintains its own long-established postal system, which does not utilize postal codes for domestic mail, and no postal codes are assigned to Hong Kong and Macau. Mail between Hong Kong, Macau and mainland China is treated as international.

399 questions
2
votes
2 answers

Is there a library for normalizing postal codes?

Users of my application are asked for their country and postal code. I want to use the postal codes as a key in data store. Because the postal codes are entered by the user they can have been entered in different forms. For example a Canadian user…
Adam
  • 43,763
  • 16
  • 104
  • 144
2
votes
2 answers

Pattern match a partial British postcode

I have this pattern in a php project I inherited. ^(([gG][iI][rR] {0,}0[aA]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y])))…
2
votes
2 answers

PHP - array_multisort ? Sorting postal code (zip code)

After calculating distances between two points using latitude and longitude, I've created an array which looks like this: $enterprises = array(); //Ex.: Array ( [0] => Array ( [A0A0A0] => 0 ) [1] => Array ( [A0A1A0] => 22.794344863539 ) for ($i=0;…
Pobe
  • 364
  • 3
  • 13
2
votes
6 answers

UK Postcode Database With Co-ordinates

I've downloaded a database from here which seems to be just what I need: - http://www.freemaptools.com/download-uk-postcode-lat-lng.htm Except for the fact it doesn't appear to contain Northern Ireland postcodes. Does anyone know what I can do about…
user1049944
2
votes
1 answer

How to return and display json data with getJSON properly?

file "zip.json": { "zip11111": "City1", "zip99999": "City2" } the javascript: jQuery(document).ready(function() { $("#textbox1zip").change(function() { $.getJSON('zip.json', function(data) { /* each of the following code…
user2317194
  • 221
  • 1
  • 4
  • 13
2
votes
2 answers

Regular expression for UK postal codes

I'm making an application that asks the user to enter a postcode and outputs the postcode if it is valid. I found the following pattern, which works correctly: String pattern =…
AngryDuck
  • 4,358
  • 13
  • 57
  • 91
2
votes
2 answers

Postal Code verification in Scheme (Dr. Racket)

I am writing a program in Scheme (Dr. Racket) to verify Canadian postal-codes. The user inputs a postal code and gets a response whether it is valid or not. I got the boolean logic down but I am stumped as to how to actually tell it what the correct…
Trevor Hodgins
  • 95
  • 1
  • 10
2
votes
2 answers

Python Regular Expression for Outward UK Post Code

I've looked and tried the solutions of previous questions on this topic (here and here), but I can't get it to work. I'm looking for a regex for the outer part of a UK postcode. In "PO1 1AF", PO1 is the outward postcode or postcode district, with…
eamon1234
  • 1,555
  • 3
  • 19
  • 38
2
votes
2 answers

Distance between Postcodes

I am trying to find out the best way of working out distance between locations (we have the postcode and locations). Basically with each record we have a Location and Postcode, the user on the front-end can enter a postcode and select records .. -…
user997357
  • 77
  • 2
  • 8
2
votes
4 answers

Python Module for Distance between UK postcodes

I need to calculate distances between UK postcodes. I don't want to use a web api. Does a python module/ library exist for this? Or do I have to put together something of my own using data from the OrdnanceSurvey? Thanks,
slow_mondays
  • 871
  • 7
  • 19
2
votes
3 answers

UK Zip/Postal Code Range Calculation

In a logistics software which is written in C#, I need to check if given postal code is between one of the ranges at database. For Germany, for example Range: 47000-48000 Given Postal Code: 47057 Result: True for numeric postal codes, it's…
midwinter
  • 21
  • 5
1
vote
2 answers

get possible house numbers for a postcode

You see them on shopping carts etc, you type in your postcode and it gives you a list of house numbers, then the user selects the house number from the list... Is this just done with a database or is there anyway to do this using google maps or…
AlexMorley-Finch
  • 6,785
  • 15
  • 68
  • 103
1
vote
2 answers

How do I validate a Postcode on this form using JavaScript?

I'm not that experienced with JavaScript and I’ve been trying for a while now to make this form display an alert message if a postcode is entered in the wrong format when the user clicks the submit button. What I’ve achieved so far I’ve placed all…
Mat UK
  • 11
  • 1
  • 2
1
vote
2 answers

PHP: Split a postcode into two parts?

I need to split a UK postcode into two. I have some code that gets the first half but it doesn't cover everything (such as gir0aa). Does anyone have anything better that validates all UK postcodes then breaks it into the first and second half?…
Andy Lobel
  • 3,356
  • 9
  • 31
  • 40
1
vote
1 answer

Importing PAF file to MySQL

I recently purchased PAF files from the Royal Mail. I've received them all but now need to import the contents into a MySQL database. After taking a look at the files there seems to be no common delimiter or way to determine the individual…
BIOSTALL
  • 1,656
  • 12
  • 25