using System; using System.Text.RegularExpressions; using System.Linq; public class Test { public static void Main() { var str = "hello Exclude1 4:32 test test Exclude2 5:23 hello 2:19 some more text 42:3 more text"; var matches = Regex.Matches(str, @"(?()) Console.WriteLine(match.Value); } }