using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; public class Test { public static void Main() { var str = "((1+2)*(4+3))"; var pattern = @"(?=(\((?>[^()]+|(?)\(|(?<-o>)\))*(?(o)(?!)|)\)))"; var result = Regex.Matches(str, pattern) .Cast() .Select(x => x.Groups[1].Value); Console.WriteLine(string.Join("\n", result)); } }