fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9.  
  10. String s = @"-- [AUG-24-14 11:58 PM (EDT) Mickey Rahman] --------------Comm--ent 1-- [AUG-24-14 11:40 PM (EDT) Mickey Rahman] --------------Comment 2-- [AUG-22-14 11:51 PM (EDT) Automation User] --------------TEST 3";
  11. string[] parts = Regex.Split(s, @"(?<!\A)(?=-- *\[)");
  12.  
  13. int i = 1;
  14. foreach (string m in parts) {
  15. Console.WriteLine("MATCH " + i + ":" + m); ++i;
  16. }
  17.  
  18. }
  19. }
Success #stdin #stdout 0.07s 34808KB
stdin
Standard input is empty
stdout
MATCH 1:-- [AUG-24-14 11:58 PM (EDT)  Mickey Rahman] --------------Comm--ent 1
MATCH 2:-- [AUG-24-14 11:40 PM (EDT)  Mickey Rahman] --------------Comment 2
MATCH 3:-- [AUG-22-14 11:51 PM (EDT)  Automation User] --------------TEST 3