private FormatterTag extractFormatterTag(@NotNull CharSequence chars, int startOffset, int endOffset) {
    if (mySettings.FORMATTER_TAGS_ACCEPT_REGEXP) {
      Pattern onPattern = mySettings.getFormatterOnPattern();
      Pattern offPattern = mySettings.getFormatterOffPattern();
      if (onPattern != null && onPattern.matcher(chars.subSequence(startOffset, endOffset)).find()) return FormatterTag.ON;
      if (offPattern != null && offPattern.matcher(chars.subSequence(startOffset, endOffset)).find()) return FormatterTag.OFF;
    }
    else {
      for (int i = startOffset; i < endOffset; i++) {
        if (isFormatterTagAt(chars, i, mySettings.FORMATTER_ON_TAG)) return FormatterTag.ON;
        if (isFormatterTagAt(chars, i, mySettings.FORMATTER_OFF_TAG)) return FormatterTag.OFF;
      }
    }
    return FormatterTag.NONE;
  }
private FormatterTag extractFormatterTag(@NotNull CharSequence chars, int startOffset, int endOffset)