1
にテキストに特定の単語を置き換える回避する方法:私はこのようなメソッドを持っているのjava
for(String abc:abcs){
xyz = abc.replaceAll(abc+"\\(", "_"+abc+"\\(");
}
私はこれを試してみました
Javaで彼らのために特定の接頭辞を持っているいくつかの代替品を交換しないようにする方法
:
String data = "Today, abc.xyz is object oriented language";
String regex = "(?<!abc.)xyz";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(data);
System.out.println(matcher.find());
例の追加はどうですか? –
[ネガティブな外観]を使用してください(http://www.regular-expressions.info/lookaround.html)。 –
ya私は試しましたが、Javaではそれほど多くはありませんので、あなたはどのようにJavaでそれをやるでしょうか教えてください。 –