Text:
Abcd
Aefg
bhij
Aklm
bnop
Aqrs
(Note, there is no newline after the last line)
Python code:
print(re.findall('(^A.*?$)+',Text,re.MULTILINE))
This returns
['Abcd','Aefg','Aklm','Aqrs']
However, I would like adjacent lines to be returned as one set:
['Abcd\nAefg','Aklm','Aqrs']
How should I solve this with Python?