using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
string pattern = @"\d{6}[\w\d]\d";
List<string> valid = new List<string>();
List<string> notValid = new List<string>();
List<string> text = new List<string>() {
"18065900", "15074500", "16198300", "15228200", "13372700", "13012400", "16232400",
"17041900", "17422500", "14391800", "16366400", "11111111", "16262300", "12428000",
"13243700", "15366300", "152508A0", "14335900", "17414700", "17330200", "136542A2",
"NotValid", "134554AO", "11I132A0"
foreach(var item in text)
Match result = Regex.Match(item, pattern);
Console.WriteLine("Valid Entries:");
foreach(var item in valid)
Console.Write($"{item} ");
Console.WriteLine(string.Empty);
Console.WriteLine("Unvalid Entries:");
foreach(var item in notValid)
Console.Write($"{item} ");