using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"!1s(?<id>[^!]+).+!3d(?<latitude>[^!]+)!4d(?<longitude>[^!]+)";
string input = @"/data=!4m7!3m6!1s0x54905cd11489942f:0x6a68c79cf58b8d9!8m2!3d47.4556324!4d-122.2566178!16s%2Fg%2F1tvtb18c!19sChIJL5SJFNFckFQR2bhYz3mMpgY?authuser=0&hl=en&rclk=1
/data=!4m7!3m6!1s0x54906acdccf44db1:0x6da0c1f2d7a6736e!8m2!3d47.61404!4d-122.3281!16s%2Fg%2F11b6hykyrc!19sChIJsU30zM1qkFQRbnOm1_LBoG0?authuser=0&hl=en&rclk=1";
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