2016-03-02 62 views
0

如何刪除配對中不存在的額外報價。 假設,刪除除配對以外發生的報價

title:"no spacing before" and text breaks " 
title:"no spacing before" and text breaks " after this 

我需要輸出如下:

title:"no spacing before" and text breaks 
title:"no spacing before" and text breaks after this 
+0

如果你想得到真正的幫助,請用1)編程語言,2)你的代碼,3)你的代碼有什麼問題/你需要什麼幫助來更新你的問題。 –

回答

0

您可以使用這樣的正則表達式:

(".*?")|" 

隨着替換字符串:

\1 

Working demo

enter image description here

0

以下的正則表達式應該適用於多對雙引號(「),並符合對組。要刪除雙引號不配對,以\ 1替換匹配:

([^"]*(?:"[^"]+"[^"]*)+[^"]*)(["])? 

演示是HERE