def parse_element(raw_element: str) -> List[Element]:
    """
    Parse a raw element into text and indices (integers).
    """
    elements = [regex.match("^(([a-zA-Z]+)\(([^;]+),List\(([^;]*)\)\))$",
                            elem.lstrip().rstrip())
                for elem
                in raw_element.split(';')]
    return [interpret_element(*elem.groups()[1:])
            for elem in elements
            if elem]
Parse a raw element into text and indices (integers).