using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\d{8}[A-Z]\d{5}";
string input = @"123456789
987654321
987654322
987654323
98765432A12312
987654325
987654326
987654327
987654328
987654329
666218502
773218502
772218502
443218502
641218502
525.52.6969B
515-54-6976-A
555516316S
123.45.6789
987.65.4321
987.65.4322
987.65.4323
987.65.4324
987.65.4325
987.65.4326
987.65.4327
987.65.4328
987.65.4329
666.21.8502
773.21.8502
772.21.8502
772-21-8502
772218502
443.21.8502
641.21.8502";
Match m = Regex.Match(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