#region 验证数字
public static bool strIsNum(string str)
{
return Regex.IsMatch(str, "^[0-9]*$");
}
#endregion
#region 验证传真
public static bool strIsFax(string str)
{
return Regex.IsMatch(str, @"86-\d{3,4}-\d{7,8}");
}
#endregion
#region 验证邮政编码
public static bool strIsPostCode(string str)
{
return Regex.IsMatch(str, @"\d{6}");
}
#endregion
#region 验证电子邮件
public static bool strIsEmail(string str)
{
return Regex.IsMatch(str, @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");
}
#endregion
#region 验证网址
public static bool strIsNAddress(string str)
{
return Regex.IsMatch(str, @"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?");
}
#endregion
public static bool strIsNum(string str)
{
return Regex.IsMatch(str, "^[0-9]*$");
}
#endregion
#region 验证传真
public static bool strIsFax(string str)
{
return Regex.IsMatch(str, @"86-\d{3,4}-\d{7,8}");
}
#endregion
#region 验证邮政编码
public static bool strIsPostCode(string str)
{
return Regex.IsMatch(str, @"\d{6}");
}
#endregion
#region 验证电子邮件
public static bool strIsEmail(string str)
{
return Regex.IsMatch(str, @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");
}
#endregion
#region 验证网址
public static bool strIsNAddress(string str)
{
return Regex.IsMatch(str, @"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?");
}
#endregion