The dialog filled its texts with String.replace, which reads $& and $' in the replacement as patterns: a host named c$&1 showed as c%(hosts)s1. The values now go in through a function, which inserts them as they are.