把count("xxx") > 2 替换为 xxx>2
------解决方案--------------------------------------------------------
- C# code
void Main(){ String str="count(\"xxx\") > 2"; str=Regex.Replace(str,@"[^()]+\(""([^""]+)""\)\s*(\S+)\s*(\S+)","$1$2$3"); Console.WriteLine(str); //xxx>2}
------解决方案--------------------------------------------------------
- C# code
string temp = @"count(""xxx"") > 2"; temp = Regex.Replace(temp,@"\w+?\((['""]?)([^'""]+?)\1\)\s*?(.*?)","$2$3"); //xxx > 2