How to split based off two characters "["
& "]"
in a string. For example calling .split() on the following would give...
x = "[Chorus: Rihanna & Swizz Beatz]
I just wanted you to know
...more lyrics
[Verse 2: Kanye West & Swizz Beatz]
I be Puerto Rican day parade floatin'
... more lyrics"
x.split()
print(x)
would give
["I just wanted you to know ... more lyrics", " be Puerto Rican day parade floatin' ... more lyrics]
This is different from the duplicate because its not splitting by multiple delimiters, its splitting by text enclosed in brackets when the text isnt necessarily known...