|
Posted by Dylan Parry on 11/29/06 12:16
nemo@nemo_spam.com wrote:
> Any chance of your divulging the expression to check for the validity
> of format of UK postcodes, please?
I would maybe use something like:
/^[A-Z]{1,2}[1-9][0-9]? [0-9][A-Z]{2}$/
Although, I haven't tested it in the slightest, but basically it should
read something like: One or two uppercase letters, followed by a digit
between 1 and 9 and, optionally, another digit between 0 and 9. Then,
after a space, a single digit between 0 and 9, followed by two uppercase
letters. It doesn't take into account more complicated issues such as
whether that postcode is real though.
I'd be interested to see what Toby came up with :)
--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk
Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
Navigation:
[Reply to this message]
|