日期:2014-05-20 浏览次数:20909 次
string test = "abc and deandf and \"hij and abc and def or dcd\" or \"abc\""; Regex reg = new Regex(@"(?s)\b(?:and|or)\b(?=(?:(?:[^""]*""){2})*[^""]*$)"); string[] result = reg.Split(test); foreach (string s in result) { richTextBox2.Text += s + "\n"; }