常用正则表达式
1、判断在字符在字符串,有没有值。
public bool isExists(string str)
{
if (str != "")
{
return Regex.Match(str, "[a-eA-E]").Success;
}
else
{
return true;
}
}
2、判读是否全是数字:
Regex.IsMatch(TextBox5.Text.ToString().Trim(),@"^\d+$")
浙公网安备 33010602011771号