开发者

phone number prefix

开发者 https://www.devze.com 2023-03-03 15:40 出处:网络
How 开发者_StackOverflowwould I take a phone number like: 15556667777 and some how get its country code (prefix, the 1).. But, the issue is.. I will have to be able to get ANY numbers country prefix f

How 开发者_StackOverflowwould I take a phone number like: 15556667777 and some how get its country code (prefix, the 1).. But, the issue is.. I will have to be able to get ANY numbers country prefix from any phone number. So whether it be UK, AU, US, any INTL country.


It seems like a pretty complicated parsing, with lots of exceptions. You should try some libraries for this purpose:

Google's library: http://code.google.com/p/libphonenumber/ (Java and JavaScript versions)

There's a python port: http://pypi.python.org/pypi/phonenumbers/3.3a1

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号