2012-04-26 77 views
1

我想匹配Visual Studio的正則表達式查找/替換不工作,因爲我希望

EchoCancellation = Convert.ToBoolean(SendReceivePackets.GetNameValuePairsFromUnparsedReply(parsedReply["EchoCancellation"])); 

並將其更改爲:

EchoCancellation = Convert.ToBoolean(parsedReply["EchoCancellation"]); 

有關於這些3000。

這裏是我的正則表達式:

SendReceivePackets\.GetNameValuePairsFromUnparsedReply\(parsedReply\["{\w*}"\]\) 

Visual Studio中說,它無法找到它。我不相信Visual Studio,我認爲它只是懶惰。 :)

任何人都可以看到問題嗎?

回答

1

\w:w

Visual Studio使用非標準的正則表達式。您正則表達式更改爲

SendReceivePackets\.GetNameValuePairsFromUnparsedReply\(parsedReply\[":w"\]\) 

入住這裏:http://msdn.microsoft.com/en-us/library/2k3te2cs%28v=vs.80%29.aspx

+0

微軟,只是喜歡保持事情標準化呵呵。順便說明一下。謝謝! – 2012-04-26 21:52:53

相關問題