The problem you have is that to replace all occurrences, you have to use the g regex flag. But you’re not using regex, you’re just selecting a string, so you don’t have access to that. As a result, you’ll just replace the first instance.
You can do a number of things to fix. One option is described above. Another option is to loop through the string rather than the dictionary, then just check each character in turn, replacing if they need replacing. It allows you to avoid using replace completely if you set it up right as well.
I found this chapter here (https://eloquentjavascript.net/09_regexp.html) helped me much better understand the full structure/possibilities of RegEx than was as described in the course materials.