600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 详解C#常用正则验证函数的示例代码

详解C#常用正则验证函数的示例代码

时间:2018-12-22 06:34:17

相关推荐

详解C#常用正则验证函数的示例代码

后端开发|C#.Net教程

C#,正则,函数

后端开发-C#.Net教程1、Ip地址验证

成绩查分网站源码,ubuntu 禁止上传6,tomcat6换7出了问题,克服反爬虫方法,基于PHP校园食堂点餐管理系统,深度seo优化lzw

/// public static bool CheckIp(string ip){ bool result = false; Regex ipReg = new Regex(@"^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\. (\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$"); if (ipReg.IsMatch(ip)) { result = true; } return result;}

2、价格验证

老悲视频系统v8源码开源,Ubuntu横向显示应用,tomcat+5+最新版本,苹果手机爬虫代码,php适不适合开发支付系统,莱芜网站seolzw

/// /// /// public bool CheckPrice(string priceStr){ bool result = false; Regex regex = new Regex(@"^\d+(\.\d{1,2})?$", RegexOptions.IgnoreCase); Match match = regex.Match(priceStr); if (match.Success) { result = true; } return result;}

3、正整数验证

接金币 源码,vscode编写安卓,ubuntu软健,tomcat启动源码详解,爬虫监控网,php 参数 引用 传递,百色谷歌seo公司,公司注册网站模板,商品展示模板lzw

/// public static bool CheckPositiveInteger(string numStr){ bool result = false; Regex regex = new Regex(@"^[1-9]\d*$", RegexOptions.IgnoreCase); Match match = regex.Match(numStr); if (match.Success) { result = true; } return result;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。