libphonenumber

Google's C++ library for parsing, formatting, and validating phone numbers

brewmacoslinux
Try with needOr install directly
Source

About

C++ Phone Number library by Google

Commands

phonenumbertool

Examples

Validate a phone number for a specific country$ phonenumbertool --input=+14155552671 --country=US
Format a phone number in international format$ phonenumbertool --input=14155552671 --country=US --format=INTERNATIONAL
Extract and parse phone numbers from text$ phonenumbertool --input='Call me at +1-415-555-2671' --extract