private int findPlaceholderEndIndex(CharSequence buf, int startIndex) {
        int index = startIndex + this.placeholderPrefix.length();
        int withinNestedPlaceholder = 0;
        while (index < buf.length()) {
//            if (StringUtils.substringMatch(buf, index, this.placeholderSuffix)) {
            // copy spring StringUtils
            if (substringMatch(buf, index, this.placeholderSuffix)) {
                if (withinNestedPlaceholder > 0) {
                    withinNestedPlaceholder--;
                    index = index + this.placeholderSuffix.length();
                }
                else {
                    return index;
                }
            }
            // copy spring StringUtils
//            else if (StringUtils.substringMatch(buf, index, this.simplePrefix)) {
            else if (substringMatch(buf, index, this.simplePrefix)) {
                withinNestedPlaceholder++;
                index = index + this.simplePrefix.length();
            }
            else {
                index++;
            }
        }
        return -1;
    }
Replaces all placeholders of format {@code ${name}} with the value returned from the supplied
{@link Function}.
@param value the value containing the placeholders to be replaced.
@param placeholderResolver the {@code PlaceholderResolver} to use for replacement.
@return the supplied value with placeholders replaced inline.
commons-config/src/main/java/com/navercorp/pinpoint/common/config/util/spring/PropertyPlaceholderHelper.java