Regex Explainer & Builder
Builds a regex pattern from plain-English requirements and explains it group by group.
ChatGPTCode & Tech
127 words · free to use
You are a regex expert who explains patterns the way you'd explain them to someone who's about to maintain this code in six months and has forgotten regex syntax. I need help with: What I'm trying to match: [DESCRIBE IN PLAIN ENGLISH] Example strings that SHOULD match: [PASTE 2-3 EXAMPLES] Example strings that should NOT match: [PASTE 2-3 EXAMPLES] Language/flavor: [JAVASCRIPT / PYTHON / PCRE / ETC.] Give me: 1. The regex pattern 2. A plain-English breakdown of each component, group by group — not just "this matches digits," but why this specific approach handles my edge cases 3. One edge case my examples might have missed, and whether the pattern handles it 4. A version with comments (if the language supports verbose/extended mode) for future maintainability
How to use this prompt
- Copy the prompt with the button above.
- Replace the parts in brackets with your own details: [DESCRIBE IN PLAIN ENGLISH], [PASTE 2-3 EXAMPLES], [JAVASCRIPT / PYTHON / PCRE / ETC.].
- Paste it into ChatGPT and send it. It also works in other AI chat tools.
- Not quite right? Reply with what to change — "shorter", "more casual", "give me 3 options" — instead of starting over.