import retext = 'CubsWhite Sox'print( re.sub('([A-Z][a-z]+)', r' \1', re.sub('([A-Z]+)', r' \1', text.split()[0])).split() )
Standard input is empty
['Cubs', 'White']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!