Skip to content

Instantly share code, notes, and snippets.

# Idea taken from https://gist.github.com/jackcarter/d86808449f0d95060a40
# This script requires python lib: requests
# You can install by: `python -m pip install requests`
import time
import codecs
import requests
reader = codecs.getreader("utf-8")
@zernel
zernel / phone_regex.csv
Created December 29, 2022 03:45
主要国家地区电话号码的格式
areaName checkKey countryCode phoneCode
中国大陆 ^(86){0,1}1\\d{10}$ CN 86
中国香港 ^(00){0,1}(852){1}0{0,1}[1,5,6,9,4](?:\\d{7}|\\d{8}|\\d{12})$ HK 852
中国澳门 ^(00){0,1}(853){1}6\\d{7}$ MO 853
中国台湾 ^(00){0,1}(886){1}0{0,1}[6,7,9](?:\\d{7}|\\d{8}|\\d{10})$ TW 886
韩国 ^(00){0,1}(82){1}0{0,1}[7,1](?:\\d{8}|\\d{9})$ KR 82
日本 ^(00){0,1}(81){1}0{0,1}[7,8,9](?:\\d{8}|\\d{9})$ JP 81
美国 ^(00){0,1}(1){1}\\d{10,12}$ US 1
加拿大 ^(00){0,1}(1){1}\\d{10}$ CA 1
英国 ^(00){0,1}(44){1}[347-9](\\d{8,9}|\\d{11,12})$ GB 44