对比(?:pattern) 与 (?=pattern)
例子如下
“Windows 2000”字段分别采用以下两种正则表达式匹配:
String pattern4 = "(2000)|Windows (?=95|98|NT|2000)";
String pattern5 = "(2000)|Windows (?:95|98|NT|2000)";
Pattern compile5 = Pattern.compile(pattern5);
Pat...
原创
2019-11-30 09:32:35 ·
229 阅读 ·
0 评论