0

I need to split "WUBWUBIWUBAMWUBWUBX" such that I get the words ['I','AM','X'] I tried using this line:

l=re.split("([W][U][B])+","WUBWUBIWUBAMWUBWUBX")

I got the output like :

['', 'WUB', 'I', 'WUB', 'AM', 'WUB', 'X']
Zephyr
  • 11,891
  • 53
  • 45
  • 80

0 Answers0