import re


def replace_pair(pair, content):
    """
    Uses regex to locate a pair.
    First element of the tuple is the original error token.
    Second element of the tuple is the replacement token.
    References:
        :func:`re.sub`

    Args:
        pair (tuple): Error token, replacement token
        content (str): Content of the file
    Returns
        str: Corrected file content.
    """
    return re.sub(pair[0], ' {} '.format(pair[1]), content)