using System; using System.Text.RegularExpressions; public class Test { public static void Main() { string s = " Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 480x480 [SAR 1:1 DAR 1:1], 868 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn (default)"; Match m = Regex.Match(s, @"\b([0-9]+(?:\.[0-9]+)?) fps\b"); if (m.Success) { Console.WriteLine(m.Groups[1].Value); } } }