fork 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 texts = new List<string> { "Paybacks: blah","Paybacks:blah","Paybacks blah"};
  12. var pattern = new Regex(@"Paybacks[\s:]*(.*)", RegexOptions.IgnoreCase);
  13. texts.ForEach(text => Console.WriteLine(pattern.Match(text)?.Groups[1].Value));
  14. }
  15. }
Success #stdin #stdout 0.06s 27708KB
stdin
Standard input is empty
stdout
blah
blah
blah