using System;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
string[] data = {"TE33", "FR56", "not", "blahblahAJ00blah"};
foreach(string myString in data) {
if(Regex.IsMatch(myString, "^[A-Za-z]{2}[0-9]{2}$")) {
Console.WriteLine("{0} matches", myString);
} else {
Console.WriteLine("{0} doesn't match", myString);
}
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CiAgICAgICAgICAgICAgICBzdHJpbmdbXSBkYXRhID0geyJURTMzIiwgIkZSNTYiLCAibm90IiwgImJsYWhibGFoQUowMGJsYWgifTsKCiAgICAgICAgICAgICAgICBmb3JlYWNoKHN0cmluZyBteVN0cmluZyBpbiBkYXRhKSB7CgkJICAgIGlmKFJlZ2V4LklzTWF0Y2gobXlTdHJpbmcsICJeW0EtWmEtel17Mn1bMC05XXsyfSQiKSkgewogICAgICAgICAgICAgICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSgiezB9IG1hdGNoZXMiLCBteVN0cmluZyk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoInswfSBkb2Vzbid0IG1hdGNoIiwgbXlTdHJpbmcpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KCX0KfQ==