import re


def get_filename_components(filename):
    """Decomposes a standard note filename

    A standard filename has the form of
    2_03_04a_5_Some_Topic_fb134b00b
    Where 2_03_04a_5 define the order within
    the hierachy of notes (in this case 4 levels),
    Some_Topic is the base of the filename
    and fb134b00b is a unique identifier.
    The return value is
    ['2_03_04a_5','Some_Topic','fb134b00b']

    Args:
        filename (str): The filename of a note

    Returns:
        list: List of strings with the components of the filename
    """
    components = []
    id_filename = ''
    if re.match(r'.*_[0-9a-f]{9}\.md$', filename):
        id_filename = filename[-12:-3]
        filename = filename[:-13]
    else:
        id_filename = ''
        filename = filename[:-3]
    # Split by first underscore followed by a character = Non-Digit
    if re.match(r'^\d', filename):
        ordering_filename = re.split(r'_\D', filename, maxsplit=1)[0]
        base_filename = filename[(len(ordering_filename)+1):]
    else:
        ordering_filename = ''
        base_filename = filename
    components = [ordering_filename, base_filename, id_filename]
    return components