AI Regex Explainer
Paste a regex, get a plain-English breakdown of what it matches.
Any pattern — anchors, groups, lookarounds, character classes.
JavaScript, Python, or PCRE — small syntax differences change what a construct actually means.
In the order the pattern actually matches, not an alphabetized glossary of the symbols present.
Most regex explainers work like a glossary: list every symbol found in the pattern and define it in isolation. That's fine for `\d` and `+`, but it falls apart on the two constructs regex newcomers actually get wrong — capturing groups and lookarounds — because a glossary entry for "lookahead" doesn't explain that it's a zero-width assertion that checks for a pattern without consuming characters or including it in the match, which is the actual source of confusion. This tool walks the pattern token by token in match order and explicitly names both: capturing vs. non-capturing groups, and the zero-width, non-consuming nature of lookaround assertions, every time they appear. Given `^(?<year>\d{4})-(?!13)(\d{2})-(\d{2})$` in JavaScript flavor, the explanation identifies the named capture group `year`, the negative lookahead specifically blocking a literal month value of "13" (not just "there's a lookahead here"), and the two unnamed capturing groups for month and day — not a generic "this matches a date-like string." Flavor matters because small syntax differences change meaning: Python's `(?P<name>...)` named-group syntax isn't identical to JavaScript's `(?<name>...)`, so the explanation is tuned to the flavor selected rather than treating all regex dialects as interchangeable. It's built for anyone who has to read someone else's regex — reviewing a PR, debugging a validation rule, or picking up a codebase with patterns but no comments explaining them. Anchors (`^`, `$`, ``), alternation, and backreferences get the same treatment as groups and lookarounds: named and placed in the match order, not left as an unexplained symbol in a pattern that otherwise reads as fully decoded. One honest limitation: extremely long or deeply nested patterns can produce a longer explanation than is comfortable to read in one pass — for those, pasting one sub-pattern at a time usually gets a clearer answer than the whole thing at once. Built by EngraveOcean as part of a small, growing set of free AI developer utilities, alongside AI Error/Stack Trace Explainer and AI JSON Schema Explainer.