|
Posted by nemo on 11/29/06 15:20
On Wed, 29 Nov 2006 12:16:58 +0000, Dylan Parry
<usenet@dylanparry.com> wrote:
>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 :)
I think that would fall foul of, say, Central London postcodes - many
years ago, I lived at London WC1B 4BB
Navigation:
[Reply to this message]
|