fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. 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)";
  9. Match m = Regex.Match(s, @"\b([0-9]+(?:\.[0-9]+)?) fps\b");
  10. if (m.Success) {
  11. Console.WriteLine(m.Groups[1].Value);
  12. }
  13. }
  14. }
Success #stdin #stdout 0.07s 27428KB
stdin
Standard input is empty
stdout
29.97