import re


def diff_replace_old_new(diff):
    """Return the (old, new) filenames from difference tuple `diff`."""
    match = re.search(r"replaced '(.+)' with '(.+)'", diff[-1])
    if match:
        return match.group(1), match.group(2)
    else:
        return None, None