日期:2014-05-17 浏览次数:20436 次
void Main() { String str="count(\"xxx\") > 2"; str=Regex.Replace(str,@"[^()]+\(""([^""]+)""\)\s*(\S+)\s*(\S+)","$1$2$3"); Console.WriteLine(str); //xxx>2 }
------解决方案--------------------
string temp = @"count(""xxx"") > 2"; temp = Regex.Replace(temp,@"\w+?\((['""]?)([^'""]+?)\1\)\s*?(.*?)","$2$3"); //xxx > 2