Regular expressions (often called "regex" or "regexes") are a miniature special-purpose programming language that lives inside Python.
Regular expressions can seem quite cryptic and quite terse because every character in a regular expression represents a whole statement and regular expressions are usually written without whitespace or comments.
Hello friendly web visitor! 👋
This page is part of Python Morsels, an online Python skill-building service.
The best way to learn is by doing. In the case of Python that means writing Python code. If you'd like to improve your Python skills every week, try out Python Morsels by entering your email below to create an account.
Python Morsels topics pages are free and the first month's worth of exercises is free as well. You don't need to enter payment details to sign up.
You can find explanations of many other Python topics by signing up below.