if cy_matches:
last_cy_match = cy_matches[-1]
if last_cy_match.end() > last_year_pos:
y_str = last_cy_match.group(1).replace(" ", "")
current_year = int(f"20{y_str}")
is_new_block = True
# Точечный патч: захват оторванной даты и кварталов из начала суффикса (сдвиг при разрыве страницы)
if not is_new_block:
orphan = re.match(r'\s*(?:\d+\.\d{3}\s+)?(?:\d{2}\.\d{2}\.\d{4}\s*-|календарный\s+год)[^\)]*\)?', section[match.end():match.end()+250], re.DOTALL)
if orphan:
between_text += " " + orphan.group(0)
y_m = re.search(r'\d{2}\.\d{2}\.(\d{4})\s*-', orphan.group(0))
current_year = int(y_m.group(1)) if y_m else current_year
is_new_block = True
# Ищем кварталы
q_matches = re.findall(r'(I{1,3}|IV)\s*квартал', between_text)