import re


def get_fixed_line(line, matched_typo, fix):
    """
    >>> get_fixed_line('There isss a typo', 'isss', 'is')
    'There is a typo'

    >>> get_fixed_line('There is a tpyo', 'tpyo', 'typo')
    'There is a typo'

    >>> get_fixed_line('Theer is a typo', 'Theer', 'There')
    'There is a typo'
    """
    if re.search(r"^" + matched_typo + r"(\W)", line):
        return re.sub(r"^" + matched_typo + r"(\W)", fix + r"\1", line, count=1)
    elif re.search(r"(\W)" + matched_typo + r"$", line):
        return re.sub(r"(\W)" + matched_typo + r"$", r"\1" + fix, line, count=1)
    elif re.search(r"(\W)" + matched_typo + r"(\W)", line):
        return re.sub(
            r"(\W)" + matched_typo + r"(\W)", r"\1" + fix + r"\2", line, count=1
        )

    return line