1
의 텍스트에서 특정 단어를 대체하지 않도록하는 방법 :나는이 같은 방법이 자바
for(String abc:abcs){
xyz = abc.replaceAll(abc+"\\(", "_"+abc+"\\(");
}
나는이 시도
자바 그들을 위해 특정 접두사가 몇 교체를 교체하는 일이 없도록하는 방법
:
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());
예제를 추가하는 것은 어떻습니까? –
[negative lookbehind] (http://www.regular-expressions.info/lookaround.html)를 사용하십시오. –
나중에 내가 시도했지만, 너무 많이 자바에, 그래서 당신이 내게 어떻게 자바에서 할 줄 알았습니까? –