How to split this string where __
is the delimiter
MATCHES__STRING
To get an output of ['MATCHES', 'STRING']
?
For splitting specifically on whitespace, see How do I split a string into a list of words?.
To extract everything before the first delimiter, see Splitting on first occurrence.
To extract everything before the last delimiter, see partition string in python and get value of last segment after colon.