-1
我需要一個正則表達式來僅允許alpahnumric,但不僅僅是字符串。例如。只有號碼8977
應該被拒絕。包含至少一個非數字字符的字母數字正則表達式
private void txtCompanyName_Validated(object sender, EventArgs e) {
if(!System.Text.RegularExpressions.Regex.IsMatch(txtCompanyName.Text, @"^[0-9A-Za-z ]+$")) {
MessageBox.Show("This accepts only alphabetical characters And Numbers");
txtCompanyName.Focus();
}
}