fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var str = "hello Exclude1 4:32 test test Exclude2 5:23 hello 2:19 some more text 42:3 more text";
  10. var matches = Regex.Matches(str, @"(?<!Exclude1 )(?<!Exclude2 )\d+:\d+");
  11. foreach (var match in matches.Cast<Match>())
  12. Console.WriteLine(match.Value);
  13. }
  14. }
Success #stdin #stdout 0.07s 34088KB
stdin
Standard input is empty
stdout
2:19
42:3