正则表达式高手请来帮帮忙 谢谢
string s=@"Sum(x1 , x2, Sum(x3 , x4) + Sum(x5 , x6, (x7 + x8 )*x9))+ Sum(x1 , x2,Sum(x3 , x4)+Sum(x5 , x6))+ Sum(x1,x2,Sum( x3,x4) + Sum(x5,x6,( x7 + x8 )* x9))";
说明:正则表达式中的x1,x2.....为函数的参数
用一个正则表达式 匹配出所有函数
例如:匹配结果1:Sum(x1 , x2, Sum(x3 , x4) + Sum(x5 , x6, (x7 + x8 )*x9))
匹配结果2:Sum(x1 , x2,Sum(x3 , x4)+Sum(x5 , x6))
匹配结构3:Sum(x1,x2,Sum( x3,x4) + Sum(x5,x6,( x7 + x8 )* x9))
------解决方案--------------------Sum\(((?<o>\()
------解决方案--------------------(?<-o>)\)
------解决方案--------------------[^()]+)*(?(o)(?!))\)