import re


def get_sanitize_patterns(string):
    """
    *Arguments*

    string:  str

        String containing a list of regex-replace pairs as would be
        read from a sanitize config file.

    *Returns*

    A dictionary of regex-replace pairs. If the input string contains
    the same regex multiple times, the last one will take effect.

    """
    matches = re.findall('^regex: (.*)$\n^replace: (.*)$',
                         string,
                         flags=re.MULTILINE)
    pats = {key: val for (key, val) in matches}
    return pats