最新下载
热门教程
- 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
{
//没有找到
}
相关文章
- 星塔旅人怎么去白雾 星塔旅人反和谐方法介绍 10-26
- 星塔旅人怎么去圣光 星塔旅人反和谐相关设置分享 10-26
- 星塔旅人签到自选五星怎么选 五星角色选择建议分享 10-26
- 伊莫虹光星魔师捕捉攻略 10-26
- 原神秘闻馆奈芙尔私房钱获取攻略 10-26
- 二重螺旋图纸获取攻略 10-26