using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
var s = "<a href=\"/url?q=https://www.google.com/&sa=U&ved=0ahUKEwizwPy0yNHSAhXMDpAKHec7DAsQFgh6MA0&usg=AFQjCNEjJILXPMMCNAlz5MN1IIzjpr79tw\">";
var pattern = @"<a href=""/url\?q=(.*?)&";
var result = Regex.Match(s, pattern);
Console.WriteLine(result.Groups[1].Value);