I have a big block of text:
SELECT TOP 10 * FROM APPLES
GO
SELECT TOP 10 * FROM PEARS TREE
GO
SELECT TOP 10 * FROM FRUITS
...
And I'm simply trying to split this text into a list of individual strings based around GO, this works:
commandlist = textblock.split("GO")
but.. what I'd like to do is use something like:
commandlist = textblock.split(r"\bGO\b")
because I'm expecting some text to look like:
SELECT TOP 10 * FROM GOPATRIOTS
GO
SELECT TOP 10 * FROM PEARS LETITGO
GO SELECT TOP 10 * FROM FRUITS
...
but it seems that I can't just shove a regex into split? Or can I and I'm just missing the way to do so?
re.split. So basic, I can't find a dupe.