Fix register replace regex which was too greedy.

For example, it used to replace foo_key_file fields as well whereas only
key_file should have been replaced.