Uplers interview question

Regex questions to replace a substring