fork(1) download
  1. import re
  2. import sys
  3.  
  4. text = sys.stdin.read()
  5. blocks = re.findall(r'(?sm)^Part 1$(.*?)^Part 0$', text)
  6. print(*blocks, sep='\n***\n')
Success #stdin #stdout 0.04s 9560KB
stdin
Ненужный текст
Part 1
A1
Kh A
A4
H6
Part 0
Ненужный текст
stdout
A1
Kh A
A4
H6