我已经尝试了很多东西,但我无法弄清楚如何去下面的字符串匹配正则表达式问题
这是我的例子。 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