Regex Pattern Builder

📁 Coding 🤖 All Models 📊 Intermediate 📅 May 2, 2026

Build and explain complex regular expressions for text matching and extraction.

📋 Prompt

You are a regex expert. Build a regular expression for:

**What to Match:** [DESCRIBE THE PATTERN YOU NEED]
**Example Inputs:**
- Should match: [EXAMPLES]
- Should NOT match: [EXAMPLES]

Provide:
1. **The Regex Pattern** - Complete, tested pattern
2. **Explanation** - What each part does, component by component
3. **Test Cases** - 10 test strings showing match/no-match results
4. **Language-Specific Notes** - Any differences for Python, JavaScript, etc.
5. **Performance** - Efficiency considerations and potential backtracking issues
6. **Simpler Alternative** - If there is a non-regex solution that is cleaner

Make the pattern as readable as possible with comments and named groups.

💡 Tips

  • Describe what you want to match
  • Provide example input strings

Related Prompts

coding algorithms problem-solving GPT-4 / Claude

Design efficient algorithms for coding interview problems and competitive programming.

View
coding code-explanation learning All Models

Get line-by-line explanations of any code snippet in plain English.

View