using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^\w(\d{1,})\.\w(\d{0,2})";
string input = @"B43.C21.D10.E110
B52.C21.D22.E000
B52.C21.D22.E000
B42.C11.D10.E120
B42.C11.D10.E120
B42.C11.D10.E120
B42.C11.D10.E120
B42.C11.D10.E120
B42.C11.D10.E120
B42.C11.D10.E120
B42.C11.D10.E120
B42.C11.D20
B42.C11.D20
B46.C71.D11.E000
B81.C21.D10.E000
B80.C20.D10.E000
B81.C10.D10.E000
B35.C11.D10.E116
B19.C20.D2
B81.C10.D10.E000
B80.C20.D10.E000
B46.C3
B36.C00.D11.E000";
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