deftripNumsAlpha():'''patt=re.compile(r"[^0-9]") then we would get like str1=''.join(re.findall(patt,"1215北京"))
str1=>'北京'.Now you see what you want to .
'''import re
patt=re.compile(r"[^0-9a-zA-Z]")
lis1
python清除文本中数字、空格的方法原文地址:https://blog.csdn.net/u013671341/article/details/19245827def tripNumsAlpha(): '''patt=re.compile(r"[^0-9]") then we would get like str1=''.join(re.findall(patt,"1215北京")) str1=>'北京'.Now you see what you want to .