import re test = "A123A456A" law_list = re.findall('(?=A(.*?)A)', test, re.DOTALL) print(law_list)
Standard input is empty
['123', '456']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!