code: static private int findPlaceholderEndIndex(CharSequence buf, int startIndex) {
      	int index = startIndex + placeholderPrefix.length();
      	int withinNestedPlaceholder = 0;
      	while (index < buf.length()) {
      		if (StringUtils.substringMatch(buf, index, placeholderSuffix)) {
      			if (withinNestedPlaceholder > 0) {
      				withinNestedPlaceholder--;
      				index = index + 1;
      			}
      			else {
      				return index;
      			}
      		}
      		else if (StringUtils.substringMatch(buf, index, placeholderPrefix)) {
      			withinNestedPlaceholder++;
      			index = index + placeholderPrefix.length();
      		}
      		else {
      			index++;
      		}
      	}
      	return -1;
      }
docs: ---------------