using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"TEMPO\s*\K.*?(?=(?:TEMPO|\s*$))";
string input = @"VHHH 020218Z 0202/0306 20010KT 9999 FEW015 SCT025 TX32/0206Z TX32/0306Z TN27/0222Z TEMPO 0202/0209 2500 -TSRA SHRA FEW010CB SCT015 TEMPO 0215/0221 3500 SHRA FEW015CB SCT020 TEMPO 0221/0303 2500 -TSRA SHRA FEW010CB SCT015 TEMPO 0303/0306 3500 SHRA FEW015CB SCT020=
";
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