import re


def is_date_index(index):
    """
    Checks whether the index is of the agreed upon date format.
    In this case YYYY.MM.DD. This is a very 'EU' centric date.
    Would have preferred YYYY-MM-DD which is more ISO, however
    there are dates which exist in the 'EU' format already (topbeat).

    Note that match is very fast. It is faster than doing search and
    pulling groups. Using this method helps decouple using a single
    regex pattern for all things. While using this method along with
    get_date_from_index() below is 2n, we can ensure cognitive load
    is low - which is a secondary goal of this repo.

    :param index:
    :return:
    """
    date_pattern = '.*?-\d{4}[-/:.]\d{2}[-/:.]\d{2}'
    match = re.match(date_pattern, index)
    if match is not None:
        return True

    return False