import re
somethings = "Rise to vote, sir."somethings=somethings.lower()somethings=re.sub("[\s+\.\!\/_,$%^*(+\"\‘]+|[+——!,。??、~@#¥%……&*()]+", "",somethings)print(somethings)
去除字符串中的中英文字符,用正则
原文:https://www.cnblogs.com/skbarcode/p/10802891.html