How to split up phone numbers? - Mailing list pgsql-general

From Andreas
Subject How to split up phone numbers?
Date
Msg-id 4F425D6F.8010802@gmx.net
Whole thread Raw
Responses Re: How to split up phone numbers?  (Andy Colson <andy@squeakycode.net>)
Re: How to split up phone numbers?  (Rainer Pruy <Rainer.Pruy@Acrys.COM>)
Re: How to split up phone numbers?  (Vojtěch Rylko <vojta.rylko@seznam.cz>)
Re: How to split up phone numbers?  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
Hi,
is there a way to split up phone numbers?
I know that's a tricky topic and it depends on the national phone number
format.
I'm especially interested in a solution for Germany, Swizerland and Austria.

I've got everything in a phone number column that makes hardly sense like:
+49432156780
0049 4321 5678 0
04321/5678-0
and so on...
Those 3 samples are actually the same number in different notations.

Aim would be to get a normalized number split up in 4 seperate columns
nr_nation
nr_city
nr_main
nr_individual

so I end up with
49   4321   5678   0     for central
49   4321   5678   42   for Mr. Smith

Is this doable?

It would be a start to at least split off nr_nation and nr_city.

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: How can I get list of views that are using given column in table?
Next
From: Andy Colson
Date:
Subject: Re: How to split up phone numbers?