Regular Expression Debugger

Debug and fix regular expressions that don't match as expected

6/11/2026
Prompt
Help me debug my regular expression that's not working correctly.

**Programming Language:** {{LANGUAGE}}
**Current regex pattern:** `{{REGEX}}`
**Regex flags:** {{FLAGS}}

**Test strings that SHOULD match:**
```
{{SHOULD_MATCH}}
```

**Test strings that should NOT match:**
```
{{SHOULD_NOT_MATCH}}
```

**Current results I'm getting:** {{CURRENT_RESULTS}}
**What I want to capture:** {{CAPTURE_GROUPS}}

Please provide:
1. **Pattern Analysis**: Break down what the current regex matches
2. **Issue Identification**: Explain why it's not matching as expected
3. **Fixed Regex**: Provide the corrected pattern
4. **Pattern Explanation**: Step-by-step explanation of the fixed regex
5. **Capture Groups**: Explain what each group captures
6. **Edge Cases**: Test cases for edge cases
7. **Performance Check**: Identify potential catastrophic backtracking
8. **Language-Specific Notes**: Any language-specific regex quirks

Or press ⌘C to copy

Variables (7)

Replace these placeholders with your own content before using the prompt.

[{LANGUAGE][{REGEX][{FLAGS][{SHOULD_MATCH][{SHOULD_NOT_MATCH][{CURRENT_RESULTS][{CAPTURE_GROUPS]

Ready to use?

Copy and paste into your favorite AI tool

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...