import re


def get_list_or_none(pattern, text):
    """
    Similar function to get_value_or_none except in this case we want our match
    to be a list of strings instead of a single string.

    For example if our match is 'Slovenia, Croatia, Serbia' we would rather have this information split
    into a list of countries. (e.g. ['Slovenia', 'Croatia', 'Serbia'])

    This function will try to find the match and it will also split the string
    if the match is found. 

    Parameters:
        pattern : regex pattern
            pattern that we are looking for
        text : string
            the text in which we are looking for a match

    Returns
        list of strings or None if no match is found.
    """

    temp = re.findall(pattern, text)
    if len(temp) > 0:
        return temp[0].split(',')
    else:
        return None