using System; using System.Text.RegularExpressions; using System.Linq; using System.Collections.Generic; public class Test { public static void Main() { var txt = "[he[[llo][qw[[qwe:]sdsdfsdf [note2]"; var res = Regex.Match(txt, @"^(\[[^]]*])+"); Console.WriteLine(res.Value); var captures = res.Groups[1].Captures.Cast().Select(p => p.Value).ToList(); Console.WriteLine(string.Join(", ", captures)); } }