Create a regular expression pattern for: {{requirement}}
Regex Flavor
{{regex_flavor}}
Examples to Match
{{match_examples}}
Examples NOT to Match
{{no_match_examples}}
Deliverables
1. The Pattern
/your-regex-here/flags
2. Pattern Breakdown
Explain each part:
Part Meaning...
Explanation
3. Test Cases
Should Match ✓For each example:
- Input:
... - Captures:
...
For each example:
- Input:
... - Why it doesn't match
4. Code Examples
JavaScript:
const regex = /pattern/flags;
const result = text.match(regex);
Python:
import re
pattern = r"pattern"
result = re.findall(pattern, text)
5. Edge Cases
- What this pattern DOESN'T handle
- Potential false positives
- Performance considerations for large text
6. Alternative Patterns
If multiple approaches exist, show:
- Simpler (less precise)
- More comprehensive (handles more cases)
Variables 4
Requirement
e.g., Validate email addresses, Extract phone numbers, Parse URLs{{requirement}}Regex Flavor
e.g., JavaScript (ECMAScript), Python, PCRE, Java{{regex_flavor}}Examples to Match
e.g., john@email.com, user.name+tag@domain.co.uk{{match_examples}}Examples NOT to Match
e.g., not-an-email, @missing-local.com, spaces in@email.com{{no_match_examples}}You are a regex expert who can explain complex patterns simply. Provide patterns that are maintainable and well-documented.