Sorry everyone, I should remember never to post regexes to a list
without testing them first. Spent a little time in Q/A and discovered
that this original one passed through all kinds of rubbish.
Jon Reades wrote:
m/
[A-PR-UWYZ]
(?:
[0-9](?:[0-9]|A-HJKS-UW])?
|
[A-HK-Y][0-
I recall that Hong Kong is BFPO 1. :)
Send mail thousands of miles overseas for the price of a 1st class stamp...
--
Mike
(Learning Perl with the 3rd edition, but very slowly.)
On Tuesday 01 April 2003 14:35, David M. Wilson wrote:
> The only other thing I could offer you is a recommendation to buy the
> PAF if your budget allows it.
all I can say on that point is 'streetmap' and 'LWP' are two rather fine
words/accronyms aren't they.
hey ho :)
--
Robin Szemeti
Red
This hardly qualifies as a clear RegEx, but I *think* that this fits all
of the rules as summarised below:
m/
[A-PR-UWYZ]
(?:
[0-9](?:[0-9]|A-HJKS-UW])?
|
[A-HK-Y][0-9](?:[0-9]|[ABEHMNPRVWXY])?
)
\s
\d[ABD-HJLNP-UW-Z]{2}
/x
All this is while leaving out, for the time
On Tue, 01 Apr 2003 17:16:20 +0200, you ("Philip Newton"
<[EMAIL PROTECTED]>) wrote:
>On 1 Apr 2003 at 13:47, Ulf wrote:
>
>> At Tuesday, 1 April 2003, you wrote:
>>
>> >>m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
>>
>> In Sweden, where I come from, postal codes are just 5 digits, so
>>
From: Jon Reades <[EMAIL PROTECTED]>
Date: 4/1/03 10:47:55 AM
> I'm doing a little UK address validation, and after
> looking around on CPAN didn't come up with much except
> Reg::Common::zip, and that didn't cover UK addresses
> (Damian, your name is on this Module, are you listening?
> :) )
From: Jon Reades <[EMAIL PROTECTED]>
Date: 4/1/03 10:47:55 AM
> I'm doing a little UK address validation, and after
> looking around on CPAN didn't come up with much except
> Reg::Common::zip, and that didn't cover UK addresses
> (Damian, your name is on this Module, are you listening?
> :) )
On Tue, 1 Apr 2003, Philip Newton wrote:
> On 1 Apr 2003 at 16:53, Nicholas Clark wrote:
>
> > It may not be clear that the "she" in question is also the head of state
> > of a lot of places (Australia, Canada, Grenada, the UK to name but a few).
>
> Ah! Brenda.
>
> (Is she still called that? My f
On Tue, Apr 01, 2003 at 04:47:25PM +0100, Paul Mison wrote:
> On 01/04/2003 at 15:43 +0100, Jon Reades wrote:
>
> >2. Outcodes of the form [A-Z]{1,2}\d[A-Z] may in fact only apply to
> >London-area addresses for the time being.
>
> I think this is right, but can't confirm it.
>
> >In fact, in a
On 1 Apr 2003 at 16:53, Nicholas Clark wrote:
> It may not be clear that the "she" in question is also the head of state
> of a lot of places (Australia, Canada, Grenada, the UK to name but a few).
Ah! Brenda.
(Is she still called that? My father sometimes uses the name, but he
came to Germany o
On Tue, Apr 01, 2003 at 04:37:51PM +0100, S Watkins wrote:
> I know I'm probably going to regret this but...
>
> Nicholas Clark wrote:
> > (The head of state in the Bailiwick of Guernsey is the Duke of Normandy.
> > I think she's also the head of state in Jersey
>
> > Nicholas Clark
>
> So.. the
On 01/04/2003 at 15:43 +0100, Jon Reades wrote:
2. Outcodes of the form [A-Z]{1,2}\d[A-Z] may in fact only apply to
London-area addresses for the time being.
I think this is right, but can't confirm it.
In fact, in a list of postcodes that I found there appeared to be only
three addresses in this
I know I'm probably going to regret this but...
Nicholas Clark wrote:
(The head of state in the Bailiwick of Guernsey is the Duke of Normandy.
I think she's also the head of state in Jersey
Nicholas Clark
So.. the "Duke" of Normandy is a "she"?
Or this some heraldic anomoly to do with location/p
On 1 Apr 2003 at 13:47, Ulf wrote:
> At Tuesday, 1 April 2003, you wrote:
>
> >>m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
>
> In Sweden, where I come from, postal codes are just 5 digits, so
> you would say:
>
> m/[0-9]{3}\s*[0-9]{2}/
Germany is even easier: /[0-9]{5}/
Since the co
On Tue, Apr 01, 2003 at 03:43:16PM +0100, Jon Reades wrote:
> And the following exceptions are also valid to some degree:
>
> 1. GIR 0AA -- a bank that sounds like they were issued this code either
> so long ago that they hadn't decided on a format, or completely by accident
GiroBank was origina
On Tue, Apr 01, 2003 at 03:43:16PM +0100, Jon Reades wrote:
> And the following exceptions are also valid to some degree:
>
> 1. GIR 0AA -- a bank that sounds like they were issued this code either
> so long ago that they hadn't decided on a format, or completely by accident
The National Giro B
On Tue, 2003-04-01 at 15:43, Jon Reades wrote:
> 1. [A-Z]0 is unused (I can find no incidences)
> 2. Outcodes of the form [A-Z]{1,2}\d[A-Z] may in fact only apply to
> London-area addresses for the time being. In fact, in a list of
> postcodes that I found there appeared to be only three addresse
This is good for simple validation, but one of the things that has
become clear from the thread is that there are a number of additional
rules that govern whether a postcode is validly formatted.
The additional rules (from a gov web site) *appear* to be:
1. The letters Q, V and X are not used i
On Tue Apr 1 11:47:55 2003, Jon Reades wrote:
> I'm doing a little UK address validation, and after looking around on
We use CGI::Untaint::uk_postcode. The "CGI" is misleading; you can use
the Untaint modules without needing any CGI stuff.
--
Marty
Subject: RegEx for UK Postal Codes
I'm doing a little UK address validation, and after looking around on
CPAN didn't come up with much except Reg::Common::zip, and that didn't
cover UK addresses (Damian, your name is on this Module, are you
listening? :) ). Almost everywhere els
At Tuesday, 1 April 2003, you wrote:
>>m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
In Sweden, where I come from, postal codes are just 5 digits, so
you would say:
m/[0-9]{3}\s*[0-9]{2}/
// Ulf Harnhammar
===
EASY and FRE
On Tue, Apr 01, 2003 at 01:12:24PM +0100, Simon Wilcox said:
> On Tue, 2003-04-01 at 13:07, Jon Reades wrote:
> >
> > Yikes, there's also BFPO...
>
> Is that actually a postcode ?
>
> AFAIK it's the acronym for British Forces Posted Overseas and is just
> part of an address that doesn't have a p
On Tue, Apr 01, 2003 at 11:47:55AM +0100, Jon Reades wrote:
> According to the government document found here (this is the google
> cache for those of you without Word):
>
> http://216.239.53.100/search?q=cache:33rseCRZr6wC:www.lscdata.gov.uk/data/Annex%2520C.doc+what+is+UK+postal+code+format&hl
On Tue, 2003-04-01 at 13:25, Jon Reades wrote:
>
> Yes, you're right -- it's military and not technically a postcode
> (neither is SAN TA1). I'd guess, however, that many people would throw
> it into the postcode field of a form since it rather 'looks like one'
> (although one wouldn't expect t
On Tue, Apr 01, 2003 at 11:47:55AM +0100, Jon Reades wrote:
> Would anyone care to offer any improvements or suggestions?
One other thought I had forgotten: there are a few 'odd' postal codes,
although you shouldn't have to worry about them. See the PDF I posted 30
seconds ago.
David.
I just came across this:
http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm
Maybe all those tax dollars spent on modernisation *are* producing
something worthwhile (online documentation, even a UML diagram!). :)
jon
--
jon reades
fulcrum analytics
t: 0870.366.9338
m: 0797.69
On Tue, Apr 01, 2003 at 01:12:24PM +0100, Simon Wilcox wrote:
> AFAIK it's the acronym for British Forces Posted Overseas and is just
> part of an address that doesn't have a postcode, as not all addresses
> need them. For instance Named Freepost addresses don't have them.
British Forces Post Offi
Yes, you're right -- it's military and not technically a postcode
(neither is SAN TA1). I'd guess, however, that many people would throw
it into the postcode field of a form since it rather 'looks like one'
(although one wouldn't expect to encounter too many of these while doing
validation).
j
> Yikes, there's also BFPO...
I seem to remember, and perhaps incorrectly, that BFPO is not part of a
postcode, and takes a form similar to:
Peter Sergeant
BFPO 5
UK
But it's been a long time since I lived somewhere reachable by one...
+Pete
--
A cucumber should be well-sliced, dressed with p
On Tue, 2003-04-01 at 13:07, Jon Reades wrote:
>
> Yikes, there's also BFPO...
Is that actually a postcode ?
AFAIK it's the acronym for British Forces Posted Overseas and is just
part of an address that doesn't have a postcode, as not all addresses
need them. For instance Named Freepost addresse
Yikes, there's also BFPO...
Why can't I be validating Canadian addresses?
Email sent to Abigail.
jon
Philip Newton wrote:
On 1 Apr 2003 at 13:23, Philip Newton wrote:
I seem to recall that there were a couple of additional weird postal
codes (from when Abigail asked on a newsgroup or mailing
On Tue, Apr 01, 2003 at 12:02:52PM +0100, Andy Kelk wrote:
> Similarly, E4 7PT is valid but E4 0PT is not.
^
I believe this statement to be false
--
Lusercop.net - LARTing Lusers everywhere since 2002
On 1 Apr 2003 at 13:23, Philip Newton wrote:
> I seem to recall that there were a couple of additional weird postal
> codes (from when Abigail asked on a newsgroup or mailing list
> somewhere).
Found it. Have a look at http://archive.develooper.com/[EMAIL PROTECTED]/,
the thread "Zip/Postal co
Paul Johnson wrote:
Jon Reades said:
I'm doing a little UK address validation, and after looking around on
CPAN didn't come up with much except Reg::Common::zip, and that didn't
cover UK addresses (Damian, your name is on this Module, are you
listening? :) ).
Abigail <[EMAIL PROTECTED]> was wo
On 01/04/2003 at 11:47 +0100, Jon Reades wrote:
So far my regex looks like this (using the {} notation for consistency
and readability):
m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
there's the interesting additional fact that C I K M O V cannot be
used in the incode (the letters that come af
On Tue, Apr 01, 2003 at 12:02:52PM +0100, Andy Kelk wrote:
> ISTR (although I can't find where now) that 0 is not valid for the
> numeric parts. I am not 100% sure on that...
I don't think that is the case, although possibly it was once. There
appear to be codes near Manchester that start at 0, an
On Tue, 1 Apr 2003, Andy Kelk wrote:
> ISTR (although I can't find where now) that 0 is not valid for the
> numeric parts. I am not 100% sure on that...
> If so, you can't have E0 7PT but you can have E20 7PT.
> Similarly, E4 7PT is valid but E4 0PT is not.
I can confirm that 0 is valid for the s
> On Tue, 1 Apr 2003, Andy Kelk wrote:
>
> > ISTR (although I can't find where now) that 0 is not valid for the
> > numeric parts. I am not 100% sure on that... If so, you
> can't have E0
> > 7PT but you can have E20 7PT. Similarly, E4 7PT is valid
> but E4 0PT is
> > not.
>
> I can confirm
Jon Reades said:
> I'm doing a little UK address validation, and after looking around on
> CPAN didn't come up with much except Reg::Common::zip, and that didn't
> cover UK addresses (Damian, your name is on this Module, are you
> listening? :) ).
Abigail <[EMAIL PROTECTED]> was working on this
Merde.
I just found:
"Edenfield",Lancashire,BL0
"Ramsbottom",Greater Manchester,BL0
"Shuttleworth",Greater Manchester,BL0
"Stubbins",Lancashire,BL0
"Asheldham",Essex,CM0
"Bradwell Waterside",Essex,CM0
"Bradwell-on-Sea",Essex,CM0
"Burnham-on-Crouch",Essex,CM0
"Deal Hall",Essex,CM0
"Dengie",Essex,C
Andy Kelk wrote:
ISTR (although I can't find where now) that 0 is not valid for the
numeric parts. I am not 100% sure on that...
If so, you can't have E0 7PT but you can have E20 7PT.
Similarly, E4 7PT is valid but E4 0PT is not.
So you could do:
m/[A-Z]{1,2}[1-9]{1,1}\d{0,1}[A-Z]{0,1}\W[1-9]{1
On 1 Apr 2003 at 11:47, Jon Reades wrote:
> I'm doing a little UK address validation, and after looking around on
> CPAN didn't come up with much except Reg::Common::zip, and that didn't
> cover UK addresses (Damian, your name is on this Module, are you
> listening? :) ).
Abigail is apparently
On Tue, Apr 01, 2003 at 11:47:55AM +0100, Jon Reades wrote:
> So far my regex looks like this (using the {} notation for consistency
> and readability):
>
> m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
Works for my list of postcodes here (except, I can only match the gross
code - the first
On Tue, 1 Apr 2003, Andy Kelk wrote:
> > So far my regex looks like this (using the {} notation for
> > consistency
> > and readability):
> >
> > m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
> >
> > According to the government document found here (this is the google
> > cache for those o
> So far my regex looks like this (using the {} notation for
> consistency
> and readability):
>
> m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
>
> According to the government document found here (this is the google
> cache for those of you without Word):
ISTR (although I can't find whe
> m/[A-Z]{1,2}\d{1,2}[A-Z]{0,1}\W\d{1,1}[A-Z]{2,2}/
I would personally rewrite it like this:
m/
[A-Z]{1,2}
\d{1,2}
[A-Z]?
\W
\d
[A-Z]{2}
/x
+Pete
--
Almost all absurdity of conduct arises from the imitation of those whom we cannot
resemble.
--
I'm doing a little UK address validation, and after looking around on
CPAN didn't come up with much except Reg::Common::zip, and that didn't
cover UK addresses (Damian, your name is on this Module, are you
listening? :) ). Almost everywhere else tried to sell me a service.
So far my regex looks
47 matches
Mail list logo