> I agree, a straight look up would be more accurate. Perhaps 
> there's a web service to check post codes.

there is - postcodeanywehere.co.uk

you can even get a dev account off them to test the service and I found them
quite helpful. Here's an example of how easy it is to check:

<cfscript>
    service ="http://services.postcodeanywhere.co.uk/uk/lookup.asmx?wsdl";;
    account = "XXXXXXXXX";
    license = "XXXX-XXXX-XXXX-XXXX";
    postcode = "BH4 9HH";
 </cfscript>

<cfinvoke method="ByPostcode" returnvariable="test"
webservice="http://services.postcodeanywhere.co.uk/lookup.asmx?wsdl";>
      <CFINVOKEARGUMENT NAME="postcode" VALUE="#postcode#"/>
      <CFINVOKEARGUMENT NAME="accountcode" VALUE="#account#"/>
        <CFINVOKEARGUMENT NAME="licensekey" VALUE="#license#"/>
</cfinvoke>

> -----Original Message-----
> From: Douglas Humphris [mailto:[EMAIL PROTECTED]]
> Sent: 27 January 2003 13:20
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] Postcode validation
> 
> 
> As I say, a first stab to get the ball rolling. Tim asked for 
> a PC validator: is that to validate that the Post Code 
> actually exists, or validate it's structure so that it could 
> possibly exist? You can't assume that the user enters in 
> upper case, unless you force it before validating.
> 
 Perhaps, though, 
> this is overkill for what Tim is wanting here.
> 
> Douglas
> 
> -----Original Message-----
> From: Paul Johnston [mailto:[EMAIL PROTECTED]]
> Sent: 27 January 2003 13:03
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] Postcode validation
> 
> 
> Hmmm... Regex:
> 
> > 
> > This is a first stab at one...
> > 
> > RegEx = ^[a-zA-Z]{1,2}[1-9]{1,2}[ ]{1}[1-9]{1,2}[a-zA-Z]{1,2}&
> 
> Wouldn't work for something like
> 
> SW1P
> 
> Which is a Westminster postcode
> 
> Adding this in it is slightly more complicated (and therefore 
> more easy to
> hack), Postcodes are always upper case too:
> 
> RegEx = ^[A-Z]{1,2}[1-9][0-9A-Z]?[ ]{1}[1-9]{1,2}[A-Z]{1,2}&
> 
> Unfortunately, this also equals:
> 
> XX1X which is definitely not a postcode
> 
> Goes back to my original statement that you need to actually 
> have a list of
> postcodes to test against, which means buying the postcode 
> database from the
> Royal Mail.
> 
> The only way to really make a postcode that isn't going to be 
> hackable is to
> have all of the postcodes!  It's not a string that can be 
> simply tested with
> a regular expression (although it can be verified as a 
> POSSIBLE postcode)
> 
> Paul
> 
> 
> 
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
> 


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to