我已經嘗試了很多東西,但我無法弄清楚如何去下面的字符串匹配正則表達式問題
這是我的例子。 Btw使用2.0緊湊框架,如果它很重要。
string received = "AT+CMEE=1\r\r\nOK\r\n";
Regex regex = new Regex(received , RegexOptions.Multiline);
// I have tried many things
Match match1 = regex.Match(".*AT\+CMEE=1\r\r\nOK\r\n.*");
Match match2 = regex.Match(".*AT\\+CMEE=1\r\r\nOK\r\n.*");
Match match3 = regex.Match(".*OK.*"); // this one completely confuses me.
我在做什麼錯?請幫忙。
預先感謝您。
我覺得你困惑的模式和字符串匹配。 – 2010-09-13 10:14:01
非常感謝。 – Chauncat 2010-09-13 10:39:49