//校验正则
const string CardIdParttern = @"(\d{6})(\d{4})(\d{2})(\d{2})(\d{2})(\d{1})([\d,x,X]{1})";
//用正则匹配CardID字符串
Match match = Regex.Match(CardID, CardIdParttern);
if (match.Success){
//如果匹配的处理逻辑
}
//校验正则
const string CardIdParttern = @"(\d{6})(\d{4})(\d{2})(\d{2})(\d{2})(\d{1})([\d,x,X]{1})";
//用正则匹配CardID字符串
Match match = Regex.Match(CardID, CardIdParttern);
if (match.Success){
//如果匹配的处理逻辑
}