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 strBackups = @"wbadmin 1.0 - Backup command-line tool
  9. (C) Copyright 2013 Microsoft Corporation. All rights reserved.
  10.  
  11. Backup time: 01.09.2015 11:51
  12. Backup target: 1394/USB Disk labeled BIGGER2(F:)
  13. Version identifier: 09/01/2015-06:51
  14. Can recover: Volume(s), File(s), Application(s), Bare Metal Recovery, System State
  15. Snapshot ID: {060e3b44-7b80-49bf-97c4-3f3b9908dec6}
  16.  
  17. Backup time: 06.09.2015 10:36
  18. Backup target: 1394/USB Disk labeled BIGGER2(F:)
  19. Version identifier: 09/06/2015-05:36
  20. Can recover: Volume(s), File(s), Application(s), Bare Metal Recovery, System State
  21. Snapshot ID: {64af3693-362d-42dc-ae5f-566b3f2d40be}
  22.  
  23. Backup time: 06.09.2015 11:00
  24. Backup target: 1394/USB Disk labeled BIGGER2(F:)
  25. Version identifier: 09/06/2015-06:00
  26. Can recover: Volume(s), File(s), Application(s), Bare Metal Recovery, System State
  27. Snapshot ID: {d9d50a01-6907-40a1-9c57-1f45de76b9ec}
  28.  
  29. ";
  30.  
  31. var regBackups = new Regex(@"\r?\n((?>\r?\n.+){5})(?!\r?\n.)",
  32. RegexOptions.Compiled
  33. );
  34.  
  35.  
  36. foreach (Match m in regBackups.Matches(strBackups))
  37. {
  38. Console.WriteLine("=============================");
  39. Console.WriteLine(m.Groups[1].Value);
  40. Console.WriteLine("=============================");
  41. }
  42. }
  43. }
Success #stdin #stdout 0.1s 24520KB
stdin
Standard input is empty
stdout
=============================

Backup time: 01.09.2015 11:51 
Backup target: 1394/USB Disk labeled BIGGER2(F:)
Version identifier: 09/01/2015-06:51
Can recover: Volume(s), File(s), Application(s), Bare Metal Recovery, System State
Snapshot ID: {060e3b44-7b80-49bf-97c4-3f3b9908dec6}
=============================
=============================

Backup time: 06.09.2015 10:36 
Backup target: 1394/USB Disk labeled BIGGER2(F:)
Version identifier: 09/06/2015-05:36
Can recover: Volume(s), File(s), Application(s), Bare Metal Recovery, System State
Snapshot ID: {64af3693-362d-42dc-ae5f-566b3f2d40be}
=============================
=============================

Backup time: 06.09.2015 11:00 
Backup target: 1394/USB Disk labeled BIGGER2(F:)
Version identifier: 09/06/2015-06:00
Can recover: Volume(s), File(s), Application(s), Bare Metal Recovery, System State
Snapshot ID: {d9d50a01-6907-40a1-9c57-1f45de76b9ec}
=============================