using System;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
string s1 = "thisIsaString-A21";
Console.WriteLine(Regex.IsMatch(s1, @"-A\d"));
string s2 = "thisIsaString-AB21";
Console.WriteLine(Regex.IsMatch(s2, @"-A\d"));
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJc3RyaW5nIHMxID0gInRoaXNJc2FTdHJpbmctQTIxIjsKCQlDb25zb2xlLldyaXRlTGluZShSZWdleC5Jc01hdGNoKHMxLCBAIi1BXGQiKSk7CgkJCgkJc3RyaW5nIHMyID0gInRoaXNJc2FTdHJpbmctQUIyMSI7CgkJQ29uc29sZS5Xcml0ZUxpbmUoUmVnZXguSXNNYXRjaChzMiwgQCItQVxkIikpOwoJfQp9