随笔分类 -  正则表达式

摘要:`c++ include bool isNum(string str){ regex num_check("[1]+$"); return regex_match(str, num_check); } ` 0-9 ↩︎ 阅读全文
posted @ 2024-10-05 11:24 Danlis 阅读(9) 评论(0) 推荐(0) 编辑
摘要:Regex reg = new Regex("^do(es)(xy)?$"); var result = reg.Match("doesxy"); foreach (var item in result.Groups) { Console.WriteLine(item); ... 阅读全文
posted @ 2018-01-16 17:13 Danlis 阅读(226) 评论(0) 推荐(0) 编辑
摘要:负向零宽断言 (?!表达式) 也是匹配一个零宽度的位置,不过这个位置的“断言”取表达式的反值,例如 (?!表达式) 表示 表达式 前面的位置,如果 表达式 不成立 ,匹配这个位置;如果 表达式 成立,则不匹配 加粗为被匹配到的: 以上为使用 .+n(?!。) 的匹配结果。注意与 .+n[^。] 匹配 阅读全文
posted @ 2017-05-17 14:32 Danlis 阅读(903) 评论(0) 推荐(0) 编辑
摘要:参考文章:https://deerchao.net/tutorials/regex/regex.htm#backreference 这篇看起来像是图书一样:http://www.ha97.com/book/OpenSource_Guide/ch26s09.html 当该字符("?")紧跟在任何一个其 阅读全文
posted @ 2017-05-11 16:34 Danlis 阅读(313) 评论(0) 推荐(0) 编辑
摘要:正则表达式-菜鸟教程: http://www.runoob.com/regexp/regexp-metachar.html 正则表达式30分钟入门教程:deerchao.net/tutorials/regex/regex.htm 在线正则表达式测试网站:http://tool.oschina.net 阅读全文
posted @ 2017-04-28 16:30 Danlis 阅读(262) 评论(0) 推荐(0) 编辑
摘要:大于0的数字:/^(?!0+(?:\.0+)?)(?:[19]\d|0)(?:\.\d1,2)?/ 这正则看不太懂,先放着 作者:Kevin Yang 使用正则表达式找出不包含特定字符串的条目 作者:sunhuaer123 http://blog.csdn.net/sunhuaer123 阅读全文
posted @ 2016-11-21 14:58 Danlis 阅读(287) 评论(0) 推荐(0) 编辑
摘要:只允许输入数字 验证数字的正则 [+-]?\d+(.\d+)? 数字的正则 阅读全文
posted @ 2016-08-08 09:19 Danlis 阅读(627) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示