import re


def re_identify_image_metadata(filename, image_names_pattern):
    """
    Apply a regular expression to the *filename* and return metadata
    :param filename:
    :param image_names_pattern:
    :return: a list with metadata derived from the image filename
    """
    match = re.match(image_names_pattern, filename)
    return None if match is None else match.groups()