using System; using System.Text.RegularExpressions; public class Test { public static void Main() { var myResponse = @" 28 Errors, 3 warning(s) "; var TdTag = Regex.Matches(myResponse, @"(?s)\s*(\d+)[^<]*"); var result = TdTag[0].Groups[1].Value; Console.WriteLine(result); } }