using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?=^|[A-Z]?\s)(.\d{1,2}[""+-]?\s.*?)(?=MS\D\D.\d|.\d\D\D\D\D\D|.\d\D\D.\d|AW\D\D\D\D\D|AW\D\D.\d)(MS\D\D.\d|.\d\D\D\D\D\D|.\d\D\D.\d|AW\D\D\D\D\D|AW\D\D.\d)";
string input = @"14+ Ywu&rb12AiBNL
18- vu20BEBNL
^15+ vwu&ob12Ai18C
C C 20"" &dg15BE23C
19- vu20AQ 5
S S 20"" w16BE26S
24 MSBE 6
N 22- MSBE15N
G22 AWAiRBa
.26"" AWFE 8";
RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase;
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