fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var r = new Regex(@"[\[\]]+");
  9. var s = "GHJ[][][[[[]]][[][][]]][][][]^^hjk[][///]]]p";
  10.  
  11. foreach (Match m in r.Matches(s))
  12. Console.WriteLine(m.Value);
  13. }
  14. }
Success #stdin #stdout 0.02s 134208KB
stdin
Standard input is empty
stdout
[][][[[[]]][[][][]]][][][]
[][
]]]