fork(6) download
  1. import java.util.regex.*;
  2.  
  3. class T {
  4. public static void main(String[] args) {
  5. String str = "This is an ant";
  6. String result = str.replaceAll("\\bis\\b", "is not");
  7. System.out.println(result);
  8. }
  9. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
This is not an ant