Build and explain regular expressions with test cases and breakdowns.
#regex
#coding
#patterns
#developer
Prompt
Create a regular expression to match [Description of pattern, e.g., US phone numbers / email domains / log timestamps].
Language/flavor: [JavaScript / Python / PCRE]
Requirements:
[Additional constraints]
Provide:
1. The regex pattern
2. Line-by-line explanation of each part
3. 5 test cases that should match
4. 5 test cases that should NOT match
5. Common pitfalls or edge cases
Customize
Fill Variables
Details
Model
GPT-4
Category
Development
Added On
Feb 1, 2025
Prompts are starting points. Review outputs before using them in production.