Code
Describe a match in English → regex with explanation, test vectors, and common footgun warnings for your chosen flavor.
This tool tackles both.
Describe matches in human language, pick a flavor so lookaheads and flags line up correctly, optionally supply labeled positive and negative test strings. You get a pattern formatted for your engine, a readable atom-by-atom explanation, and explicit warnings where engines disagree or where catastrophic backtracking can bite. The output is shaped so you can paste both the pattern and the explanation into your pull request — the next engineer who tries to "simplify" your regex will at least understand it first.
Clarity in matters out beats cleverness in.
Each engine has different feature sets and quirks.
ES2024 features
Named groups, unicode property escapes, lookbehinds — modern Node and browser runtimes.
PHP, grep -P
Full lookbehind support, recursive patterns, atomic groups — the most feature-rich common flavor.
Standard library
Familiar to data scientists; some features differ from PCRE in subtle ways the explanation calls out.
Linear time guarantees
No backreferences or arbitrary lookbehinds, but immune to ReDoS — performance-safe by construction.
awk, egrep
Minimal feature set for scripts that must run on every Unix box you SSH into.
Patterns where mistakes have a long blast radius.
A regex you cannot read is a regex that breaks in production.
Most senior engineers can write tight regex — they just refuse to, because the next person to touch it inevitably misreads a quantifier and ships a regression. This template forces a different equilibrium: the pattern is paired with an atom-by-atom explanation that any junior engineer can follow. Catastrophic backtracking and ReDoS warnings are inline with the explanation, not buried in a postscript. When tests are provided, the model walks through each one mentally and admits when something does not match instead of pretending it does. The deliverable is a pattern your team can confidently extend six months later.
Habits that prevent the 2am page.
Almost never for authentication — use a real parser library or send a verification email. Regex here is for UX hints only unless you explicitly state otherwise in the intent field.
Yes — the system prompt explicitly flags ReDoS-vulnerable patterns. Treat those warnings seriously when the pattern processes user input.
Depends on the flavor. JavaScript with the u flag, Python with re.UNICODE, and PCRE all support unicode property escapes. The explanation calls out where unicode behavior matters.
It mentally walks through each labeled test and notes mismatches in the explanation — but it does not actually execute the pattern. Always run the regex against your tests in your real engine before shipping.
Run it once per flavor — feature differences (lookbehinds, atomic groups, recursion) often require structural changes that cross-flavor translation cannot do losslessly.
Default reasoning-capable models that can walk through pattern logic correctly. Deeper models help on multi-line patterns and complex lookaround compositions.
State a readability budget explicitly in your intent field — "prefer explicit character classes over shorthand" or "split into multiple smaller patterns if needed." The model will respect the constraint.
Explainability included.
Paste the explanation into your PR so the next engineer does not "simplify" your pattern into dust. Run the supplied tests in your actual engine. Pay attention to the ReDoS warnings. Do all three and your regex will outlive most of the code around it.