Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7CF3E1337B59 for ; Thu, 23 Sep 2010 07:53:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 42951-10 for ; Thu, 23 Sep 2010 10:53:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from echo917.server4you.de (echo917.server4you.de [85.25.141.73]) by mail.postgresql.org (Postfix) with ESMTP id DF33A1337B58 for ; Thu, 23 Sep 2010 07:53:18 -0300 (ADT) Received: from localhost.localdomain (essn-d9bba277.pool.mediaWays.net [217.187.162.119]) (authenticated bits=0) by echo917.server4you.de (8.14.2/8.13.6) with ESMTP id o8NAqiZt009127; Thu, 23 Sep 2010 12:52:44 +0200 Message-ID: <4C9B3199.8040100@longimanus.net> Date: Thu, 23 Sep 2010 12:53:13 +0200 From: Andreas Schmitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.3 MIME-Version: 1.0 To: negora CC: pgsql-sql@postgresql.org Subject: Re: HowTo divide streetname from house-nr ? References: <4C9AAC85.1000001@gmx.net> <4C9AFDEC.3050601@negora.com> In-Reply-To: <4C9AFDEC.3050601@negora.com> Content-Type: multipart/alternative; boundary="------------090001030806050604090302" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201009/86 X-Sequence-Number: 34617 This is a multi-part message in MIME format. --------------090001030806050604090302 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit The only chance I see is to combine the information about the localization with the address pattern. regards Andreas On 09/23/2010 09:12 AM, negora wrote: > I guess that it's impossible to look for a solution which works on > every existing case, specially if you're handling addresses from > several countries. However, if you've certain control over the user > inputs, maybe you could try replacing certain parts employing some > kind of regular expression which removes numbers at the beginning/end > of the string. > > On 23/09/10 03:25, Andreas wrote: >> Hi, >> >> how could I divide streetnames from housenumbers ? >> >> I have to deal with input like this: >> >> Parkstreet 42 >> Parkstr. 42 >> Casle Avenue 42 >> Casle Str. 42-47 >> Casle Str. 54 - 55 >> >> probaply even >> Casle Str. 42-47 a >> >> Perhaps one could cut ap the 1st numeric char and regard everything >> left of it as the street name and the rest as house number. >> OK, this would fail with "42, Parkstreet" but those aren't to frequent. >> >> How would I do this? >> --------------090001030806050604090302 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
The only chance I see is to combine the information  about the localization with the address pattern.

regards

Andreas




On 09/23/2010 09:12 AM, negora wrote:
I guess that it's impossible to look for a solution which works on every existing case, specially if you're handling addresses from several countries. However, if you've certain control over the user inputs, maybe you could try replacing certain parts employing some kind of regular expression which removes numbers at the beginning/end of the string.

On 23/09/10 03:25, Andreas wrote:
 Hi,

how could I divide streetnames from housenumbers ?

I have to deal with input like this:

Parkstreet 42
Parkstr. 42
Casle Avenue 42
Casle Str. 42-47
Casle Str. 54 - 55

probaply even
Casle Str. 42-47 a

Perhaps one could cut ap the 1st numeric char and regard everything left of it as the street name and the rest as house number.
OK, this would fail with "42, Parkstreet" but those aren't to frequent.

How would I do this?


--------------090001030806050604090302--