using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"([-+]?\d{1,2}[.]\d{3,6})\s?,?([-+]?\d{1,2}[.]\d{3,6})";
string input = @"#Norway ?? by bike #haukåvatenet - what a beautiful ? ? listening #EmilieZoe ?61.641126 5.28856 ? june 22th, 2016 -- #swisscycling #crazyguyonabike #wildlife #wildshot #getout #adventurecycling #bike #cycling #bikearoundtheworld #bikelife #cyclingadventures #cyclingshots #cyclingtour #randobike #surlylht #randobikeVeveym
#Norway ?? by bike #haukåvatenet - what a beautiful ? ? listening #EmilieZoe ?61.641126 5.28856 ? june 22th, 2016 -- #swisscycling #crazyguyonabike #wildlife #wildshot #getout #adventurecycling #bike
#worldbybike in ?? #Denmark #Vrads #sleepingonwater in this nice #wildcamp spot. Just enough space for my #smalltent.
#adventurecycling ? 01/06/2016 ? 56.013426 ,9.431637
#worldbybike in #Norway ?? #hallingskeid #rallarvegen #crazyroad #downhill 1222m to sea level #nomorebreaks on my #surlyLHT 16.06.16";
foreach (Match m in Regex.Matches(input, pattern))
{
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