import re


def str_replace(string, substitutions: dict):
    """Replace multiple parts of string
    
    Arguments:
        string {str} -- source string
        substitutions {dict} -- dictionary of substitutions
    
    Returns:
        str
    """
    substrings = sorted(substitutions, key=len, reverse=True)
    regex = re.compile('|'.join(map(re.escape, substrings)))
    return regex.sub(lambda match: substitutions[match.group(0)], string)