import res = "HELLO there HOW are YOU"l = re.compile("(?<!^)\s+(?=[A-Z])(?!.\s)").split(s)print l
Standard input is empty
['HELLO there', 'HOW are', 'YOU']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!