Python Reg表达式删除引号内的所有文本

时间:2012-03-05 17:35:00

标签: python expression

我有这样一段文字:

According to James, "we do not know" the source of the problem, "we are clueless".

什么样的正则表达式会删除引号内的所有文字?我使用了re.sub和parantheses,但是我无法想出一个表达式来识别“s。

1 个答案:

答案 0 :(得分:0)

text = 'According to James, "we do not know" the source of the problem, "we are clueless".'
re.sub('".+?"', '', text)