当前位置: 移动技术网 > IT编程>开发语言>.net > cshtml中正则表达式使用后台代码

cshtml中正则表达式使用后台代码

2019年02月23日  | 移动技术网IT编程  | 我要评论

杨壹琳,今日3d专家预测号码,731部队女实验全集

//定义变量
bool a = false;
//正则表达式
string b = @" ^ (13[0 - 9] | 14[5 | 7] | 15[0 | 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9] | 18[0 | 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9])\d{ 8}
$";
//检查字符串与正则表达式是否匹配,结果赋值
//regex需要引用using system.text.regularexpressions
//name是要输入的内容
a = regex.ismatch(name, b);
//不匹配
if (a == false)
{
response.write("<script>alert('失败')</script>");
}
//匹配
else
{
response.write("<script>alert('成功')</script>");
}

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网