我只想报废以下格式的手机:
+1 NXX-NXX-XXXX
N=digits 2–9,X=digits 0–9
+1 is the country code that includes the US,there are 17 other countries,e.g.,Canada,Caribbean Islands.
假设我们需要找到所有以986和965开头的数字,等等(我们有一组数字)作为第一个NXX。
这是我获取电子邮件的代码:
email = soup(text=re.compile(r'[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*'))
_emailtokens = str(email).replace("\\t","").replace("\\n","").split(' ')
if len(_emailtokens):
print([match.group(0) for token in _emailtokens for match in [re.search(r"([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)",str(token.strip()))] if match])
但是我需要更改它才能获得手机。