Re: matching a street address with regular expressions

2007-10-12 Thread John Machin
On Oct 13, 4:32 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 12, 8:19 am, John Machin <[EMAIL PROTECTED]> wrote: > > > "... most of the developed world" was the [very optimistic] request. > > How does it go with "JAPAN 112-0001 TOKYO Bunkyo-Ku Hakusan 4-Chome 3- > > 2" and will it give the

Re: matching a street address with regular expressions

2007-10-12 Thread Grant Edwards
On 2007-10-12, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-10-12, Paul McGuire <[EMAIL PROTECTED]> wrote: > >> If you've got an re that can handle everything from "123 Main" to >> "221B Baker Street" to "Hollywood and Vine" to "Lot 123, Hundred of >> Foughbarre", now THAT would be something.

Re: matching a street address with regular expressions

2007-10-12 Thread Grant Edwards
On 2007-10-12, Paul McGuire <[EMAIL PROTECTED]> wrote: > I've been to Japan and Europe too, and I can't even figure out > how many digits a phone number is supposed to have! I was shocked at utterly foreign and lost I felt looking at phone numbers in various places overseas. I could deal with ph

Re: matching a street address with regular expressions

2007-10-12 Thread Grant Edwards
On 2007-10-12, Paul McGuire <[EMAIL PROTECTED]> wrote: > If you've got an re that can handle everything from "123 Main" to > "221B Baker Street" to "Hollywood and Vine" to "Lot 123, Hundred of > Foughbarre", now THAT would be something. Don't forget street addresses like: The Low Cowsheds G

Re: matching a street address with regular expressions

2007-10-12 Thread Paul McGuire
On Oct 12, 8:19 am, John Machin <[EMAIL PROTECTED]> wrote: > "... most of the developed world" was the [very optimistic] request. > How does it go with "JAPAN 112-0001 TOKYO Bunkyo-Ku Hakusan 4-Chome 3- > 2" and will it give the same result for "4-3-2 HAKUSAN BUNKYO-KU TOKYO > 112-1 JAPAN"? OK,

Re: matching a street address with regular expressions

2007-10-12 Thread Paul McGuire
On Oct 12, 8:19 am, John Machin <[EMAIL PROTECTED]> wrote: > "... most of the developed world" was the [very optimistic] request. > How does it go with "JAPAN 112-0001 TOKYO Bunkyo-Ku Hakusan 4-Chome 3- > 2" and will it give the same result for "4-3-2 HAKUSAN BUNKYO-KU TOKYO > 112-1 JAPAN"? OK,

Re: matching a street address with regular expressions

2007-10-12 Thread John Machin
On Oct 12, 4:07 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 11, 11:50 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > > > > If anyone has a first-rate address parser in Python that will cover > > most of the developed world, I'd like to talk to them. > > >

Re: matching a street address with regular expressions

2007-10-12 Thread Paul McGuire
On Oct 12, 1:07 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 11, 11:50 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > > > > If anyone has a first-rate address parser in Python that will cover > > most of the developed world, I'd like to talk to them. > > >

Re: matching a street address with regular expressions

2007-10-11 Thread Paul McGuire
On Oct 11, 11:50 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > If anyone has a first-rate address parser in Python that will cover > most of the developed world, I'd like to talk to them. > > John Nagle > SiteTruth The pyparsing e

Re: [Tutor] matching a street address with regular expressions

2007-10-11 Thread John Nagle
Shawn Milochik wrote: > On 10/4/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: >> Christopher Spears wrote: >>> One of the exercises in Core Python Programming is to >>> create a regular expression that will match a street >>> address. Here is one of my attempts. This is actually quite difficul

Re: matching a street address with regular expressions

2007-10-11 Thread Tim Chase
> Don't forget to write test cases. If you have a series of addresses, > and confirm they are parsed correctly, you are in a good position to > refine the pattern. You will instantly know if a change in pattern has > broken another pattern. > > The reason I'm saying this, is because I think your p

Re: matching a street address with regular expressions

2007-10-11 Thread Max Erickson
Andy Cheesman <[EMAIL PROTECTED]> wrote: > Check out kodos http://kodos.sourceforge.net/ for an interactive > python regexp tester > > Andy > On systems with tkinter installed(So pretty much all Windows and lots and lots of Linux systems), the redemo.py script in the Tools/Scripts directory o

Re: matching a street address with regular expressions

2007-10-11 Thread Andy Cheesman
Check out kodos http://kodos.sourceforge.net/ for an interactive python regexp tester Andy Goldfish wrote: > Don't forget to write test cases. If you have a series of addresses, > and confirm they are parsed correctly, you are in a good position to > refine the pattern. You will instantly know if

Re: matching a street address with regular expressions

2007-10-11 Thread Goldfish
Don't forget to write test cases. If you have a series of addresses, and confirm they are parsed correctly, you are in a good position to refine the pattern. You will instantly know if a change in pattern has broken another pattern. The reason I'm saying this, is because I think your pattern is in

Re: matching a street address with regular expressions

2007-10-10 Thread Karthik Gurusamy
On Oct 10, 10:02 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > On 10/4/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > > > > > Christopher Spears wrote: > > > One of the exercises in Core Python Programming is to > > > create a regular expression that will match a street > > > address. Here is

Re: [Tutor] matching a street address with regular expressions

2007-10-10 Thread Shawn Milochik
On 10/4/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Christopher Spears wrote: > > One of the exercises in Core Python Programming is to > > create a regular expression that will match a street > > address. Here is one of my attempts. > > > street = "1180 Bordeaux Drive" > patt = "\d+