Regex Wizard — Pattern Builder & Explainer
Describe what you want to match in plain English, get the regex, an explanation, and test cases.
Describe what you want to match in plain language and get a tested, explained regex pattern back.
You are a regex expert who writes precise, readable patterns. I need a regex that: [DESCRIBE IN PLAIN ENGLISH WHAT TO MATCH] Language/Engine: [JavaScript / Python / Go / Java / PCRE] Examples that SHOULD match: - [EXAMPLE 1] - [EXAMPLE 2] - [EXAMPLE 3] Examples that should NOT match: - [COUNTER-EXAMPLE 1] - [COUNTER-EXAMPLE 2] Provide: 1. THE REGEX — the final pattern, ready to copy-paste 2. EXPLAINED — break down every part of the pattern with inline comments. Use the verbose/extended format if the language supports it. 3. EDGE CASES — list 5 tricky inputs and whether they match or not, explaining why 4. PERFORMANCE NOTE — is this pattern susceptible to catastrophic backtracking? If so, provide a safer alternative. 5. CODE SNIPPET — a ready-to-use function in [LANGUAGE] that uses this regex with proper error handling 6. TEST CASES — 5 unit tests covering normal matches, edge cases, and non-matches
**Request:** Match email addresses but reject ones with plus-addressing
**Regex:** `^[a-zA-Z0-9._%\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$`
(Note: excludes `+` from local part)
**Explained:**
- `^` — start of string
- `[a-zA-Z0-9._%\-]+` — local part: letters, digits, dots, underscores, percent, hyphens (no plus)
- `@` — literal @ separator
- `[a-zA-Z0-9.\-]+` — domain: letters, digits, dots, hyphens
- `\.` — literal dot before TLD
- `[a-zA-Z]{2,}$` — TLD: 2+ letters
**Edge Case:** `user+tag@gmail.com` → ❌ No match (plus-addressing rejected)Regex is notoriously hard to write correctly from scratch. This prompt inverts the process—you describe what you want to match in plain English, and the AI builds a tested, optimized pattern with clear explanations of each component.
Use when you need to validate email addresses, phone numbers, or custom formats, when parsing log files or structured text, or when you need a regex but don't want to spend 45 minutes on regex101.
You'll receive a working regex pattern with a plain-English breakdown of each capture group and quantifier, test cases showing matches and non-matches, and edge cases the pattern handles correctly.
Describe what you want to match in plain English, get the regex, an explanation, and test cases.
Paste your slow query and get an optimized version with index recommendations and execution plan analysis.
Describe what you need in plain English, get a ready-to-paste formula with explanation and edge cases
Paste your function and get a complete test suite covering happy paths, edge cases, and error scenarios.
Systematically find and fix messy data — missing values, duplicates, outliers, and format issues