fork(2) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var s = @"{F971h}[0]<0>some result code: 1";
  12. var pat = @"{(?<timestamp>[0-9a-zA-F]+)}\[(?<subsystem>\d+)]<(?<level>\d+)>(?<messagep>.+)";
  13. var m = Regex.Match(s, pat);
  14. if (m.Success)
  15. {
  16. Console.Out.WriteLine(m.Groups["timestamp"].Value);
  17. Console.Out.WriteLine(m.Groups["subsystem"].Value);
  18. Console.Out.WriteLine(m.Groups["level"].Value);
  19. Console.Out.WriteLine(m.Groups["messagep"].Value);
  20. }
  21. }
  22. }
Success #stdin #stdout 0.12s 24656KB
stdin
Standard input is empty
stdout
F971h
0
0
some result code: 1