我正在寻找一个用python编写的正则表达式,以从文本中删除标点符号,数字和符号(例如$-。,@等),并将文本也转换为小写。
示例文本为:
I'm looking for text without the given numbers like 123, $223.423 ab-c@cde. Is it possible with the python regular expression?
输出文本为:
i looking for text without the given numbers like is it possible with the python regular expression
答案 0 :(得分:0)
ss = "I'm looking for text without the given numbers like 123, $223.423 ab-c@cde. Is it possible with the python regular expression?"
ss1 = ''.join([i for i in ss if i.isalpha() or i == " "]).replace(" "," ").lower()
print(ss1)
输出:
im looking for text without the given numbers like abccde is it possible with the python regular expression
享受