私は、次のJavaコードを持っている:Javaの正規表現否定後読み
Pattern pat = Pattern.compile("(?<!function)\\w+");
Matcher mat = pat.matcher("function example");
System.out.println(mat.find());
なぜmat.find()
リターンは本当でしょうか?私は否定的なlookbehindを使用してexample
の前にfunction
があります。それは捨てられてはいけませんか?