def METHOD_NAME(
    items: Iterable[CarrierT], validator_pattern, default: int
) -> int:
    header = _extract_first_element(items)
    if header is None or validator_pattern.fullmatch(header) is None:
        return default
    try:
        return int(header, 16)
    except ValueError:
        return default