import re


def replace_chars(token, chars_to_replace):
    """Replaces all characters in the dict with their specified replacement."""
    for c in token:
        if c in chars_to_replace:
            token = re.sub(c, chars_to_replace[c], token)
    return token