下载库 phonenumbers
def verify_phone_number(phone_number: str) -> (bool, int):
"""
校验各国手机号格式
"""
z = phonenumbers.parse(phone_number)
return phonenumbers.is_valid_number(z), z.national_number
if __name__ == '__main__':
print(verify_phone_number('+8618888888888'))
标签:__,phonenumbers,手机号,python,number,校验,phone
From: https://www.cnblogs.com/YiwenGG/p/16821970.html