def modify(phones, rule, match_result):
    """
    Modify the phones list by rule.
    :param phones:
    :param rule:
    :param match_result:
    :return: a new phones list modified according to the rule.
    """
    new_phones = []
    new_phones.extend(phones[:match_result[1]])
    new_phones.append(rule[2])
    new_phones.extend(phones[match_result[1]+len(rule[1]):])
    return new_phones