代码:
#! python3 import pyperclip,re phoneregex = re.compile(r''' (\d{3}|\(\d{3}\))? # area code (\s|-|\.)? # separator (\d{3}) # first 3 digits (\s|-|\.) # separator (\d{4}) # last 4 digits (\s*(ext|x|ext.)\s*(\d{2,5}))? # extension ''', re.VERBOSE) emailregex = re.compile(r'''( [a-zA-Z0-9._%+-]+ #username @ #@