import re text = "Name: abc and Age:24" print(re.split(r" and ",text))
Standard input is empty
['Name: abc', 'Age:24']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!