code: static int countArgumentPlaceholders3(final char[] messagePattern, final int length, final int[] indices) {
          int result = 0;
          boolean isEscaped = false;
          for (int i = 0; i < length - 1; i++) {
              final char curChar = messagePattern[i];
              if (curChar == ESCAPE_CHAR) {
                  isEscaped = !isEscaped;
              } else if (curChar == DELIM_START) {
                  if (!isEscaped && messagePattern[i + 1] == DELIM_STOP) {
                      indices[result] = i;
                      result++;
                      i++;
                  }
                  isEscaped = false;
              } else {
                  isEscaped = false;
              }
          }
          return result;
      }
docs: Counts the number of unescaped placeholders in the given messagePattern.
  
  @param messagePattern the message pattern to be analyzed.
  @return the number of unescaped placeholders.