import retext = r"{#{123}#};{#{abc}#}\n{#{345}#};{#{def}#}\n{#{789}#};{#{ghi}#}"print(re.findall(r'{#{(.*?)}#};{#{(.*?)}#}', text))
Standard input is empty
[('123', 'abc'), ('345', 'def'), ('789', 'ghi')]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!