SOAP-689: Check for the template parameter index also while replacing the text