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 input = @"Line 1732: 2014-10-12 09:21:26,672 DEBUG [Default_Thread_7] file.name.path.location - [TestStrinn Sys/1] SpecificNotification message arrived from Gateway";
  11.  
  12. Regex rgx = new Regex(@"^\s*Line\s*\d+:\s*.*?\s*file\.name\.path\.location\s*-\s*\[\s*\S+\s*([^\/]*)\/(\d+)\]\s*(\S+)");
  13.  
  14. foreach (Match m in rgx.Matches(input))
  15. {
  16. Console.WriteLine(m.Groups[1].Value);
  17. Console.WriteLine(m.Groups[2].Value);
  18. Console.WriteLine(m.Groups[3].Value);
  19. }
  20. }
  21. }
Success #stdin #stdout 0.07s 34200KB
stdin
Standard input is empty
stdout
Sys
1
SpecificNotification