code: public String replace(String word) {
          int flags = 0;
          if (ignoreCase) {
              flags = flags | Pattern.CASE_INSENSITIVE;
          }
          return Pattern.compile(pattern, flags).matcher(word).replaceAll(replacement);
      }
docs: Replace the word with its pattern.
  
  @param word The word
  @return The result