2012-03-05 89 views
-4

我有文字的身體像這裏面的所有文本:的Python reg表達式刪除引號

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

什麼樣的正則表達式會刪除引號內的所有文本?我已經使用應用re.sub用括號,但我不能拿出一個表情識別「S。

回答

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