1.判断为字母或数字
private void bool isNumOrAlp(string str) { string pattern= @"^[A-Za-z0-9]+$"; //@意思忽略转义,+匹配前面一次或多次,$匹配结尾 Match match = Regex.Match(str,pattern); return match.Success; }
1.判断为字母或数字
private void bool isNumOrAlp(string str) { string pattern= @"^[A-Za-z0-9]+$"; //@意思忽略转义,+匹配前面一次或多次,$匹配结尾 Match match = Regex.Match(str,pattern); return match.Success; }