Here is my string:
string ='First: Michael, Second: Dennis, Third: Michael, \nAssists: Michael, Scoring: Michael, Rebounds: Peter, Steals: Dennis'
This strings holds many items which represent an accolade and their recipient. I'm attempting to first determine who was the winner of the 'first' accolade, and then pull out all other items involving that recipient.
So in this case, we check who the winner of the first recipient is (Michael), and then we pull out all of the accolades (along with the name Michael) involving Michael.
So the result should be something like:
'First: Michael, Third: Michael, Assists: Michael, Scoring: Michael'
I was trying to utilize back refrencing along with look-arounds, but it got a little messy
import re
string ='First: Michael, Second: Dennis, Third: Michael, \nAssists: Michael, Scoring: Michael, Rebounds: Peter, Steals: Dennis'
re.findall('(?=First: (\w+)), (?=\w+: \w+, )|(\w+: \1,)+', string)