@Override
  public String getStringToReplace(@NotNull String foundString, @NotNull FindModel model,
                                   int startOffset, @NotNull CharSequence documentText) throws MalformedReplacementStringException {
    String replacement = model.getStringToReplace();
    if (model.isRegularExpressions()) {
      replacement = getStringToReplaceByRegexp(model, documentText, startOffset);
    }
    if (model.isPreserveCase()) {
      replacement = Registry.is("ide.find.word.based.preserve.case")
                  ? PreserveCaseUtil.applyCase(foundString, replacement)
                  : PreserveCaseUtil.replaceWithCaseRespect(replacement, foundString);
    }
    return replacement;
  }
@Override
  public String getStringToReplace(@NotNull String foundString, @NotNull FindModel model,
                                   int startOffset, @NotNull CharSequence documentText)