import re


def update_file_data(data, replace_list):
    """
    The replace list is a list of two strings, the first is a regex
    defining what is to be replaced, the second the text to replace the
    matches with
    :data: the source data on which to run the replace on
    :replace_list: list of a regex string and the string to replace with

    :returns: the updated data
    """
    regex = replace_list[0]
    new_text = replace_list[1]

    updated_data = re.sub(regex, new_text, data, flags=re.M)
    return updated_data