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
Python Examples Python Compiler ... Study Plan Python Interview Q&A Python Bootcamp Python Training ... The split() method splits a string into a list....
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-string-split
Python split() Method - GeeksforGeeks
4 weeks ago - DSA Python · Data Science · NumPy · Pandas · Practice · Django · Flask · Last Updated : 1 Jul, 2026 · split() method is used to divide a string into multiple parts based on a specified separator.
Discussions

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
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 - Split Strings into words with multiple word boundary delimiters - Stack Overflow
I think what I want to do is a fairly common task but I've found no reference on the web. I have text with punctuation, and I want a list of the words. "Hey, you - what are you doing here!?" shou... More on stackoverflow.com
🌐 stackoverflow.com
Split string with multiple delimiters in Python - Stack Overflow
I found some answers online, but I have no experience with regular expressions, which I believe is what is needed here. I have a string that needs to be split by either a ';' or ', ' That is, it h... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Mimo
mimo.org › glossary › python › string-split-method
Learn Python's String Split Method, Simplify Text Processing
Master Python's split() method to divide strings into lists with ease. Explore examples for data parsing, text tokenization, and file processing effectively.
🌐
Python Reference
python-reference.readthedocs.io › en › latest › docs › str › split.html
split — Python Reference (The Right Way) 0.1 documentation
returns [‘1’, ‘2’, ‘3’]). Splitting an empty string with a specified separator returns [‘’].
🌐
Python
docs.python.org › 3.3 › library › stdtypes.html
4. Built-in Types — Python 3.3.7 documentation
Split the string at the first occurrence of sep, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator.
Find elsewhere
🌐
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
🌐
YouTube
youtube.com › watch
Python String Splitting: String Basics & Using the .split() Method: Fundamentals - YouTube
This is a preview of the video course, "Python String Splitting". Python’s .split() method lets you divide a string into a list of substrings based on a spec...
Published   September 11, 2025
🌐
Python
docs.python.org › 3.6 › library › stdtypes.html
4. Built-in Types — Python 3.6.15 documentation
Split the string at the first occurrence of sep, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator.
🌐
Hyperskill
hyperskill.org › university › python › split-in-python
Python split(): Split Strings by Delimiter with Examples
June 5, 2026 - To use the split() function, provide the delimiter as an argument within the parentheses. The delimiter can be any character or substring that you want to use as a separator. The function searches for occurrences of the delimiter within the string and breaks it down at each occurrence. # Using whitespace as a delimiter text = "Hello World! Welcome to Python!" result = text.split() print(result) # Output: ['Hello', 'World!', 'Welcome', 'to', 'Python!'] # Using a comma as a delimiter fruits = "apple,banana,orange" result = fruits.split(",") print(result) # Output: ['apple', 'banana', 'orange']
🌐
University of Pittsburgh
sites.pitt.edu › ~naraehan › python3 › split_join.html
Python 3 Notes: Split and Join
Python 3 Notes [ HOME | LING 1330/2330 ] Splitting and Joining Strings <<Previous Note Next Note >> On this page: .split(), .join(), and list(). Splitting a Sentence into Words: .split() Below, mary is a single string. Even though it is a sentence, the words are not represented as discreet units.
🌐
Medium
medium.com › @sami.hamdiapps › python-split-string-a-comprehensive-guide-4ac16842bed4
Python Split String: A Comprehensive Guide | by Sami Hamdi | Medium
September 4, 2023 - In scenarios involving large strings or frequent string splitting operations, optimizing performance is paramount. Profiling your code and contemplating optimizations, such as employing generators or precompiled regular expressions, can bestow significant speed enhancements. Python’s string splitting prowess, epitomized by the versatile split() method and the formidable capabilities of regular expressions, equips you with the tools to handle a wide spectrum of string manipulation tasks.
🌐
YouTube
youtube.com › watch
Learn Python Split Function in 3 minutes - YouTube
Let's learn how to use the Python split function.The split() method splits a string into a list. You can specify the separator, default separator is any whit...
Published   April 9, 2025
🌐
Medium
medium.com › @huasa0115 › python-how-to-use-string-split-method-ee77458839d8
[Python] How to use String split() method? | by Yi-Ning Huang | Medium
July 16, 2025 - It splits on any sequence of whitespace characters (spaces, tabs, newlines) and it automatically removes leading/ trailing whitespaces. Extra spaces between words are treated as one separator. ... Data & Analytics Engineer in US healthcare. Writing about SQL, Python, PySpark, and the healthcare meaning behind the data.
🌐
Real Python
realpython.com › python-split-string
How to Split a String in Python – Real Python
November 4, 2024 - The .split() method in Python is a versatile tool that allows you to divide a string into a list of substrings based on a specified delimiter. By default, .split() separates a string at each occurrence of whitespace, which includes spaces, tabs, ...
🌐
Server Academy
serveracademy.com › blog › python-string-split-method
Python String split(): Split Strings the Right Way Blog | Server Academy
1 week ago - Python string split guide: master str.split() for whitespace, commas, maxsplit, rsplit, splitlines, and multiple delimiters, with verified code examples.