Regex Fundamentals
Learn metacharacters, character classes, quantifiers, and anchors.
Introduction
Regular expressions are patterns for matching text. Python's re module provides the tools to use them.
What is a Regex?
A regex is a sequence of characters forming a search pattern. r'\d+' matches one or more digits.
import re
print(re.findall(r'\d+', 'abc 123 def 456'))