import re s = "123+123"s = re.compile("(?<=\d)([+])(?=\d)").split(s)print(s)
Standard input is empty
['123', '+', '123']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!