import re


def replace_vars(s, values):
    """Replace all occurrences of variables in the given string with values"""
    retval = s
    for v_key, v_value in values.iteritems():
        replace = re.compile(re.escape('{{' + v_key + '}}'), re.IGNORECASE)
        retval = re.sub(replace, v_value, retval)
    return retval