- Phase: 7. Modules, Stdlib & Testing
- Duration: 2.5 hours
- Build and use regular expressions with the
remodule - Search, match, find all, split, and substitute text
- Use metacharacters, character classes, and quantifiers
- Work with raw strings and compiled patterns
- Extract groups and named captures
re.search(),re.match(),re.findall(),re.finditer()re.sub(),re.split()- Metacharacters:
. ^ $ * + ? {} [] \\ | () - Character classes:
\d,\w,\s,\D,\W,\S - Raw strings (
r"...") to avoid escape issues re.compile()for performance- Groups
()and named groups(?P<name>...)
Module 066: The Python Standard Library Tour
Module 068: Working with Dates and Times