Split a string by a delimiter in python October 9, 2022 by Tarik You can use the str.split method: string.split('__') >>> "MATCHES__STRING".split("__") ['MATCHES', 'STRING']