# ExPhoneNumber

[![Build Status](]( [![Hex Version](](

It's a library for parsing, formatting, and validating international phone numbers.
Based on Google's [libphonenumber]( (current metadata version: 8.13.6).

## Installation

  1. Add `:ex_phone_number` to your list of dependencies in `mix.exs`:
def deps do
  [{:ex_phone_number_fresha, "~> 0.3.4"}]

## Updating

To bump the version run `mix update_metadata`, update the version in mix.exs and create a pr

## Usage
iex> {:ok, phone_number} = ExPhoneNumber.parse("044 668 18 00", "CH")
 %ExPhoneNumber.Model.PhoneNumber{country_code: 41, country_code_source: nil,
  extension: nil, italian_leading_zero: nil, national_number: 446681800,
  number_of_leading_zeros: nil, preferred_domestic_carrier_code: nil,
  raw_input: nil}}

iex> ExPhoneNumber.is_possible_number?(phone_number)

iex> ExPhoneNumber.is_valid_number?(phone_number)

iex> ExPhoneNumber.get_number_type(phone_number)

iex> ExPhoneNumber.format(phone_number, :national)
"044 668 18 00"

iex> ExPhoneNumber.format(phone_number, :international)
"+41 44 668 18 00"

iex> ExPhoneNumber.format(phone_number, :e164)

iex> ExPhoneNumber.format(phone_number, :rfc3966)

## Copyright and License

Copyright (c) 2016-2019 NLCollect B.V.

The source code is licensed under [The MIT License (MIT)](