Regex regex = new Regex(@"(?<=\()[^()]+(?=\))");
string forContent=@"(
(DS_NE_CELL_G.BTS_NAME)-(DS_PRD_A_CELL_H.FREECOUNT)
)
/
(
(DS_NE_CELL_G.BTS_NAME)+(DS_PRD_A_CELL_H.FREECOUNT)
) >2
";
MatchCollection mm = regex.Matches(forContent);
int k = 1;
foreach (Match m in mm)
{
k++;
forContent = forContent.Replace(m.Value, k.ToString());
}
转载于:https://www.cnblogs.com/luosm/archive/2011/11/28/2266300.html