I have a text file that looks like this essentially:
Game #16406772158 starts.\n#Game No : 16406772158\n
....
wins $0.75 USD\n\n\n_
Lots of \n (new text) \n (new text) and then \n\n\n. I want to find all of the instances where this occurs in my text file. When my code looks like this, it works (but only for the first instance):
gameRegex = re.compile(r"""Game #(.+\n)*""")
game = gameRegex.search(totalContent)
When I switch to the findall method, outputting the "game" variable looks like this:
['Yl9Ui1OhAPyGV0JlCPLRrg wins $0.75 USD\n',
'G72AzGPQLTOWfYoNST1K/g wins $10 USD\n',
'4bSQFjpEWTIcsil7GJkkVA wins $39.99 USD from the main pot with three of a kind, Kings.\n',
'U3xFxCVFfFBt50sL9VgLgQ wins $1.45 USD\n', ..., ]
Very new to programming, I have no idea what to do here. I want it to look like this, where it creates a list. Within each item of the list, it displays the text up until the \n\n\n:
game = ['Game #16406772158 starts.\n#Game No : 16406772158\n***** Hand
History for Game 16406772158 *****\n$50 USD NL Texas Hold'em - Wednesday,
July 01, 00:00:01 EDT 2009 ... Yl9Ui1OhAPyGV0JlCPLRrg wins $0.75 USD\n',
'Game #16406772158 starts.\n#Game No : 16406772158\n***** Hand History for
Game 16406772158 *****\n$50 USD NL Texas Hold'em - Wednesday, July 01,
00:00:01 EDT 2009 ... Yl9Ui1OhAPyGV0JlCPLRrg wins $0.75 USD\n']