import re
somethings = "Rise to vote, sir."
somethings=somethings.lower()
somethings=re.sub("[\s+\.\!\/_,$%^*(+\"\']+|[+——!,。??、~@#¥%……&*()]+", "",somethings)
print(somethings)
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