Make sure string is literal when using in appendReplacement