A fluent, immutable regex builder for Python. Describe the pattern in plain English — get a compiled regex your teammates can actually review. Batteries included.
Edit the chain, watch the regex and the matches update instantly — real edify running in your browser.
Pattern() \ .start_of_input() \ .exactly(4).digit() \ .end_of_input()
^\d{4}$
2024 1999 90210 abcd
^(?:0x)?([A-Fa-f0-9]{4})$
optional().string("0x") capture().exactly(4).hex_digit()
Quantifiers before the token, like a sentence. Every step returns a fresh builder — nothing mutates.
exactly(4).digit()
email, URL, semver, IBAN, phone, postal — and 200+ more. Import one, call it, get a bool.
email("a@b.com") → True
Render any pattern as an ASCII or graph diagram, a plain-English explanation, or portable JSON.
# START ─▸ \d{4} ▸ END
First-class pydantic, FastAPI, and Django support, shipped as opt-in extras.
pip install edify[pydantic]