Andy Dingley wrote:
> "Rob" <> wrote in message news:<ccti7t$sh0$>...
>> Does anyone know where to get or how to integrate a post code search
>> feature? This will be for a shopping (delivery related) UK website.
>
> http://www.afd.co.uk
>
> AFD have this pretty much sewn up for the UK market. Decent product,
> easy to integrate.
And they seem to be reasonably helpful people there too.
However, if you're a cheapskate you may be able to cobble together
something of use.
Useful sources of data:
http://www.brainstorm.co.uk/post-codes2.txt
http://www.abcounties.co.uk/database/tcpdcsv.txt
http://www.evoxfacilities.co.uk/evoxptn.html
And here's my very own UK postcode validator:
#!/usr/bin/perl
$area = '[A-PR-UWYZ][A-HK-Y]?';
$district = '([0-9]{1,2}|[1-9][A-HJKMNPR-Y])';
$space = '\s+';
$sector = '[0-9]';
$unit = '[ABDEFGHJLNP-UW-Z]{2}';
while ($stringToTest = <>) {
if ( $stringToTest =~ m/^ $area $district $space $sector $unit $/ix ) {
print "is a valid postcode\n";
} else {
print "is junk\n";
}
}
--
Toby A Inkster BSc (Hons) ARCS
Contact Me -
http://www.goddamn.co.uk/tobyink/?page=132