import re
from typing import Tuple
from typing import Optional


def get_year_data(match: re.Match, mixed: bool = False) -> Tuple[int, Optional[int]]:
    """Get year data from match."""

    if mixed:
        year_string, *_ = match.groups()
    else:
        _, year_string, *_ = match.groups()

    if "-" in year_string:
        return (*map(int, year_string.split("-")),)  # type: ignore
    return int(year_string), None