instance for specific code share extraction Python regular telephone, for your reference, the specific contents are as follows

 import re mainly used regular import xlrd def is_number (s): x = int # whether digital try: (s) # if rounding, that is the number of. Return (True) except Exception as e: return False data=xlrd.open_workbook (r'C:Users123456Desktop mobile phone number / No..Xlsx','utf-8') table = data.sheet_by_name ('Sheet1') cols = list (table.col_values (0) f=open (r'C:Users123456) Desktop mobile phone number / No..Txt','w') for I in range (1100000): Print ('cols[i]', cols[i], type (cols[i])) if is_number (cols[i]): item=str (int (cols[i])) #xlrd results may have the decimal point, so it is the first digital int else:item=str (cols[i]) result = re.findall ("(86) (? 1[34578]\d{9}), item), if result # regular mobile phone number! []: f.write = (result[0][1] +'n') print (result[0][1]) 

all above is the

, want to help everyone to learn, but also hope that more A home to support the script.

you might be interested in this article:

This concludes the body part

This paper fixed link: | Script Home | +Copy Link

Article reprint please specify:Python regular implementation extraction of telephone function | Script Home

You may also be interested in these articles!