Saylor InnovationsSAYLOR INNOVATIONS

Home / Guides / Self-Hosting & Infra

Python Regex Cookbook: Named Groups, Lookahead, Greedy vs Lazy and findall Surprises

Self-Hosting & Infra beginner 6 min read $0.01 Updated 2026-10-20

A tested regex cookbook for Python re: findall with groups, named groups and groupdict, sub with backreferences and callables, lookarounds, greedy versus lazy, MULTILINE and DOTALL, VERBOSE, fullmatch versus match, $ versus \Z, and Unicode digits.

Extract IDs, dates and emails with Python's re module. Learn named groups, finditer, sub with a function, lookahead and lookbehind, greedy versus lazy matching, flags and the anchors that trip people up.

Read the full guide

The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.

Open in the Knowledge Base Agent API →