using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(\?|\&)([^=\n]+)\=([^&\n]+)";
string input = @"https://www.example.com/highlights/on-sale-01304&sa=U&ei=2ca1VJXQOYHnsASG3YGYCg&ved=0CBMQFjAA&usg=AFQjCNHucW7fFrA35qeeJbUlAbsPFQNxLg
https://www.example.com/collections/view-all-01240&sa=U&ei=2ca1VJXQOYHnsASG3YGYCg&ved=0CBgQFjAB&usg=AFQjCNGhZzf7rsslCqgHSngyFAbw_nQmvQ
https://www.example.com/highlights/overstock-and-clearance-01217&sa=U&ei=2ca1VJXQOYHnsASG3YGYCg&ved=0CB0QFjAC&usg=AFQjCNHMfQBA4AP51_ikOGyoGEx-aB0-wQ";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx