Use the str.split method:

>>> "MATCHES__STRING".split("__")
['MATCHES', 'STRING']
Answer from adamk on Stack Overflow
🌐
W3Schools
w3schools.com β€Ί Python β€Ί ref_string_split.asp
Python String split() Method
Remove List Duplicates Reverse ... Syllabus Python Study Plan Python Interview Q&A Python Training ... The split() method splits a string into a list....
🌐
Python
docs.python.org β€Ί 3.3 β€Ί library β€Ί stdtypes.html
4. Built-in Types β€” Python 3.3.7 documentation
Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done, the rightmost ones. If sep is not specified or None, any whitespace string is a separator.
Discussions

split() function splitting every character?
You call c.split() but don't do anything with the result. c continues to refer to the original, unsplit, string; so c[0] gives you the first character of that string. You possibly mean c = c.split(), but it would be better to assign it to a new variable. More on reddit.com
🌐 r/learnpython
20
44
April 27, 2022
Split a string by a delimiter in Python - Stack Overflow
Consider the following input string: 'MATCHES__STRING' I want to split that string wherever the "delimiter" __ occurs. This should output a list of strings: ['MATCHES', 'STRING'] To spli... More on stackoverflow.com
🌐 stackoverflow.com
python - How do I split a string into a list of characters? - Stack Overflow
How do I split a string into a list of characters? str.split does not work. "foobar" β†’ ['f', 'o', 'o', 'b', 'a', 'r'] More on stackoverflow.com
🌐 stackoverflow.com
Trying to understand string split()
When you're calling split() (without arguments) the split will be done on any number of spaces. It is not the same as calling split(' '). '-a-b'.split('-') # returns ['', 'a', 'b'] ' a b'.split(' ') # returns ['', 'a', 'b'] ' a b'.split() # returns ['a', 'b'] More on reddit.com
🌐 r/learnpython
7
0
January 31, 2024
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί python-string-split
Python split() Method - GeeksforGeeks
July 1, 2026 - It returns the resulting parts as a list of strings. ... Explanation: s.split(',') splits the string s at every comma and returns a list of the parts ['one', 'two', 'three'].
🌐
Mimo
mimo.org β€Ί glossary β€Ί python β€Ί string-split-method
Learn Python's String Split Method, Simplify Text Processing
To split a string into a list of substrings, you use the built-in string method .split(). Its behavior depends on the arguments you provide. ... Become a Python developer.
🌐
Python Morsels
pythonmorsels.com β€Ί string-split-method
The string split method in Python - Python Morsels
September 27, 2024 - Strings can be split by a substring separator. Usually the string split is called without any arguments, which splits on any whitespace.
Find elsewhere
🌐
Hyperskill
hyperskill.org β€Ί university β€Ί python β€Ί split-in-python
Python split(): Split Strings by Delimiter with Examples
June 5, 2026 - It allows developers to split a string based on a specified delimiter and store the resulting substrings as elements in a list.
🌐
IONOS
ionos.com β€Ί digital guide β€Ί websites β€Ί web development β€Ί python split
How to split strings with Python split - IONOS
February 1, 2023 - Set maxsplit to 2 and run Python split for a double split. This is the code: colors = "blue, red, yellow, orange" print(colors.split(", ", 2)) ... While the default variant is to split using commas or spaces, you can also split strings within specific words. In the following example, we use animal names again and split them at the letter a.
🌐
ReqBin
reqbin.com β€Ί code β€Ί python β€Ί nxrhfweu β€Ί python-split-string-example
How do I split a string in Python?
December 20, 2022 - There are at least five ways to split a string in Python. The simplest and most commonly used method is a string.split(), which by default splits a Python string into a list of substrings using spaces, tabs, and line breaks.
🌐
OpenStax
openstax.org β€Ί books β€Ί introduction-python-programming β€Ί pages β€Ί 8-5-splitting-joining-strings
8.5 Splitting/joining strings - Introduction to Python Programming | OpenStax
March 13, 2024 - A string in Python can be broken into substrings given a delimiter. A delimiter is also referred to as a separator. The split() method, when applied to a string, splits the string into substrings by using the given argument as a delimiter.
🌐
YouTube
youtube.com β€Ί watch
🐍 Python Tutorial #27: Splitting and Joining Strings - YouTube
In this quick Python tutorial, we cover two essential string methods: split() and join().You’ll learn:βœ… How to use split() to turn strings into listsβœ… How to...
Published: June 29, 2025