Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E84CC1337B6F for ; Thu, 23 Sep 2010 04:19:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 92914-09 for ; Thu, 23 Sep 2010 07:19:28 +0000 (UTC) X-Greylist: delayed 00:06:38.69285 by SQLgrey-1.7.6 Received: from oproxy1-pub.bluehost.com (oproxy1-pub.bluehost.com [66.147.249.253]) by mail.postgresql.org (Postfix) with SMTP id 4F3581336DB6 for ; Thu, 23 Sep 2010 04:19:27 -0300 (ADT) Received: (qmail 8229 invoked by uid 0); 23 Sep 2010 06:13:39 -0000 Received: from unknown (HELO box398.bluehost.com) (69.89.31.198) by oproxy1.bluehost.com.bluehost.com with SMTP; 23 Sep 2010 06:13:39 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=negora.com; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=IbB49TKqgPR1jDkwhrUVcb6Pccsg0Coy0h6IhP+mDB61+1lTnsALJ5xT2X0SQlEEisgFTC4/HL32KyuMV/BW6S3I+0/woKtceBjxXkEHbIAQNBRlKDRfJUNFQrb85qor; Received: from 30.red-80-32-234.staticip.rima-tde.net ([80.32.234.30] helo=[172.16.0.2]) by box398.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Oyfz5-0004s9-0s for pgsql-sql@postgresql.org; Thu, 23 Sep 2010 01:12:47 -0600 Message-ID: <4C9AFDEC.3050601@negora.com> Date: Thu, 23 Sep 2010 09:12:44 +0200 From: negora User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Lightning/1.0b1 Thunderbird/3.0.8 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: HowTo divide streetname from house-nr ? References: <4C9AAC85.1000001@gmx.net> In-Reply-To: <4C9AAC85.1000001@gmx.net> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Identified-User: {2410:box398.bluehost.com:negoraco:negora.com} {sentby:smtp auth 80.32.234.30 authed with negora+negora.com} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.176 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.723, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201009/83 X-Sequence-Number: 34614 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?