最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
c# 验证中文 数字 整数的正则表达式
时间:2022-06-25 05:02:52 编辑:袖梨 来源:一聚教程网
c# 验证中文 数字 整数的正则表达式
整数
regex.ismatch(inputerstr, "^([0-9]{1,})$")
数字
regex.ismatch(inputerstr, "^([0-9]{1,}[.][0-9]*)$")
英文字母
bool bb = regex.ismatch("/sdfsdf/", @"^/[a-z]*/$");
看一款支持中文正则
string[] sentences =
{
"你",
"x"
};
bool find = false;
string spattern = this.content.text;
foreach (string s in sentences)
{
if (system.text.regularexpressions.regex.ismatch(spattern,s))
{
//找到了
}
else
{
//没有找到
}
相关文章
- 婚姻保鲜秘诀 09-03
- 淘宝卖家进货渠道全解析 09-03
- 硬盘噪音大?试试这5招降噪 09-03
- TPLink TLWR960N 无线路由器上网时间限制功能设置 09-03
- 360电脑救援使用指南 09-03
- 360人工救援解决电脑故障 09-03