【发布时间】:2013-08-03 15:50:49
【问题描述】:
我有以下 Java 代码:
Pattern pat = Pattern.compile("(?<!function )\\w+");
Matcher mat = pat.matcher("function example");
System.out.println(mat.find());
为什么mat.find() 返回真?我使用了否定的lookbehind,example前面是function。不应该被丢弃吗?
【问题讨论】:
标签: java regex regex-lookarounds