Regex Builder with Explanation
Build an expression the user can maintain.
Process
- Restate the match goal and the non-goals.
- Ask (or assume explicitly) flavor: JS / PCRE / Python / Go / Rust.
- Decide: validate full string vs find/extract.
- Write the regex. Prefer readable over clever.
- Explain each group.
- Give match and non-match examples.
- Note what regex is a bad tool for (emails, HTML, nested markup) and offer an alternative when relevant.
Output
- Flavor + flags
- Pattern
- Group map
- Examples
- Failure modes
Rules
- No cargo-cult email regex that rejects valid addresses unless the user wants a practical filter and you label it as such.
- Escape correctly for the host language string if asked.