fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var text =
  9. @"Supplier
  10. Aker Solutions Malaysia,
  11. PKFZ Malaysia
  12. Aker Solutions Malaysia,
  13. PKFZ Malaysia
  14. QS Plan ID/Project
  15. ITP Number";
  16.  
  17. var match = Regex.Match(text, "Supplier\n(?:(?!QS).*\n)*(.*)\n(.*)");
  18. var res1 = match.Groups[1];
  19. var res2 = match.Groups[2];
  20.  
  21. Console.WriteLine(res1);
  22. Console.WriteLine(res2);
  23. }
  24. }
Success #stdin #stdout 0.04s 134720KB
stdin
Standard input is empty
stdout
QS Plan ID/Project
ITP Number