I'm gonna split a list based on capital letters but the ones that include white space:
list = ['Blue Jackets', 'KingsDucks', 'Senators', 'Oilers', 'Jets', 'Golden Knights', 'Hurricanes', 'RangersIslandersDevils']
and I expect it gives me this:
out =['Blue Jackets', 'Kings','Ducks', 'Senators', 'Oilers', 'Jets',
'Golden Knights', 'Hurricanes',
'Rangers', 'Islanders', 'Devils']
I used re:
for team in list:
separated=re.findall('[A-Z][^A-Z]*', team)
but it does not seems accurate as it splits for example 'Blue Jackets' into 'Blue' and 'Jackets' which is not right for me