111,092
社区成员




reg="^[a-z,A-Z]|\d$"
bool b = Regex.IsMatch(strText,@"^[a-zA-Z].*?\d$");
//==========
int nStart = (strText[0] | 0x0020);管他3 7 21 转换小写 大小写字母只有一位之差
int nEnd = strText[strText.Length - 1];
bool b = (nStart >= 'a' && nStart <= 'z') && (nEnd >= '0' && nEnd <= '(');
string txt = @"Demo";
Console.WriteLine(Char.IsLetter(txt[0]));
Console.WriteLine(Char.IsDigit(txt[txt.Length - 1]));
这种问题也就没必要用正则了