rx_sequence = re.compile('^(.+?)\\n\\n((?:[A-Z]+\\n)+)', re.MULTILINE)
rx_blanks = re.compile('\\W+')
text = """Some varying text1
AAABBBBBBCCCCCCDDDDDDD
EEEEEEEFFFFFFFFGGGGGGG
HHHHHHIIIIIJJJJJJJKKKK
Some varying text 2
LLLLLMMMMMMNNNNNNNOOOO
PPPPPPPQQQQQQRRRRRRSSS
TTTTTUUUUUVVVVVVWWWWWW
"""
for match in rx_sequence.finditer(text):
    title, sequence = match.groups()
title = title.strip()
sequence = rx_blanks.sub('', sequence)
print('Title:', title)
print('Sequence:', sequence)
print()
Python regular expression matching a multiline block of text