import re


def get_index(part):
    """
    check if the part is, e.g [123]
    return 123 or None
    """
    index = None
    match = re.match(r'\[(\d+)\]', part)
    if match:
        index = int(match.group(1))
    return index