import re


def extract_data_from_log(data, pattern):
    """!
    Function for extracting data out of a log file using regex matching.
    Returns all regex match objects.

    @param data: Raw data from the log file.
    @param pattern: Regex pattern to use for matching.
    """
    matches = list()
    for line in data:
        matches.append(re.match(pattern, line))
    return matches