Phone - Telephone number parser, to get info from country, area, etc

Hi people,

I created a parser for telephone numbers to get information based only in the number.
I started this project cause I will need this kind of info in the future. Right now, It’s based on a regex parser and I created a parser for every sovereign country. I removed territories under other countries sovereignty, even if it has it’s own international calling code.
Help is needed on doing the area codes for all countries. Everyone can help, if not coding, you can help us finding official information of how the numbering plan for a given country works. :smiley:
Github
Hex

4 Likes

Nice :023:

Have a look at the standard library by Google: GitHub - google/libphonenumber: Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers.
It’s what many language specific libraries use format spec from, such as GitHub - sstephenson/global_phone: Parse, validate, and format phone numbers in Ruby using Google's libphonenumber database (Ruby)

3 Likes

Thanks @AstonJ :smiley:

I’ven seen libphonenumber when I was searching for something that could fit my use case, but it doesnt. :sweat:
I needed to identify the country solely based on the number, but the demos for libphonenumber shows that it is focused on formatting and need to specify the country.
There is an erlang/elixir wrapper for libphonenumber:

2 Likes

Hi @cevado,

libphonenumber can detect the country if the number has “+”-Format.
Example: http://libphonenumber.appspot.com/phonenumberparser?number=%2B4917632181859

2 Likes

Thanks @IljaN :smile:

I didn’t know that. I guess I tried it fully formated, with spaces and parenthesis. I will keep the package that I’m maintaining, if it is useful for more people I’ll keep it alive. :slight_smile:

2 Likes