String.replace() invoked with function to avoid "$&" being replaced with search pattern.