using System;
using System.Text.RegularExpressions;
using RegexMatchValues;
var text = "Use 22/7 for pi.";
var (denominator, numerator) = Regex.Match(text, @"(?<nu>\d+)/(?<de>\d+)").Get<(int, int)>("de", "nu");
Console.WriteLine((double) numerator / denominator);