fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var txt = "[hel[[lo][qw[[qwe:]sdsdfsdf [note2]";
  10. var res = Regex.Matches(txt, @"\G\[[^]]*]").Cast<Match>().Select(p => p.Value).ToList();
  11. Console.WriteLine(string.Join("", res));
  12. }
  13. }
Success #stdin #stdout 0.13s 24760KB
stdin
Standard input is empty
stdout
[hel[[lo][qw[[qwe:]