replaceLastWildcardWithIndex