regex强大工具:org.apache.oro.text.regex中的PatternMatcher使用之contains()与matchs()的区别
来源:互联网 发布:淘宝主图要求规范2017 编辑:程序博客网 时间:2024/05/27 21:49
区别:
一、contains()识别的内容可以输入内容的部分;但是matchs()必须要整个输入内容都符合pattern才算通过。
举个例子:
输入内容为:3231 432432 432424
regex pattern:\\b\\d+\\b
使用matchs():压根不匹配
使用contains():
contain 1: 3231
contain 2: 432432
contain 3: 432424
输入内容换成:432432
使用matchs():匹配
使用contains():匹配
区别二:
同样传入PatternMatcherInput的实例,contains()会update这个实例的状态,但是matchs()不会!!!!!!!!!!!!!
- regex强大工具:org.apache.oro.text.regex中的PatternMatcher使用之contains()与matchs()的区别
- regex强大工具:org.apache.oro.text.regex中的MatchResult
- regex强大工具:org.apache.oro.text.regex中的PatternMatcherInput使用
- regex强大工具:org.apache.oro.text.regex下的Util源码解读之substitute()方法1
- org/apache/oro/text/regex/MalformedPatternException
- org/apache/oro/text/regex/MalformedPatternException
- 解决:ClassNotFoundException: org.apache.oro.text.regex.MalformedPatternException
- Caused by: java.lang.ClassNotFoundException: org.apache.oro.text.regex.PatternCompiler
- Python Xpath与Regex的区别
- Regex++的安装、编译与使用
- Regex类的使用。
- VS2010 regex的使用
- boost regex的使用
- C#System.Text.RegularExpressions.Regex使用(一)
- C#System.Text.RegularExpressions.Regex使用(二)
- C#System.Text.RegularExpressions.Regex使用(一)
- C#System.Text.RegularExpressions.Regex使用(一) .
- C#System.Text.RegularExpressions.Regex使用(二) .
- arcgis 创建网络数据集
- Wine QQ 安装等问题
- java有用链接
- eclipse常用快捷键和调试
- 用opencms创建首页时页眉和页脚没出现?
- regex强大工具:org.apache.oro.text.regex中的PatternMatcher使用之contains()与matchs()的区别
- Android开发指南-窗口小部件(App Widgets)
- Linq 的 Case
- JDK 中KERTOOL工具的使用方法
- C# 判断文件名中是否有非法字符
- junit单元测试
- rsync使用时的常见问题
- 字符串按固定格式的处理
- log4j 详解