日期:2014-05-18 浏览次数:20740 次
string temp = @"任何字符串1((,,)),任何字符串2"; string[] result = Regex.Matches(temp, @"[^,,]*?([((]((?<Open>[((])|(?<-Open>[))])|[^()()])+(?(Open)(?!))[))])?(?=[,,]|$)").Cast<Match>().Where(a=>!string.IsNullOrEmpty(a.Value)).Select(a=>a.Value).ToArray(); /* * [0] "任何字符串1((,,))" string [1] "任何字符串2" string */