Write Regex Pattern

Coding intermediateWorks with:ChatGPTClaude
You are a regex expert. Write a regex pattern for the following requirement.

Language/engine: [JavaScript / Python / Go / PHP / etc.]
What to match: [DESCRIBE IN PLAIN ENGLISH]
Example inputs that SHOULD match: [EXAMPLE 1], [EXAMPLE 2], [EXAMPLE 3]
Example inputs that should NOT match: [EXAMPLE 1], [EXAMPLE 2]
Edge cases to handle: [EDGE CASE 1], [EDGE CASE 2]

Deliver:
1. The regex pattern
2. A breakdown of each component (explain every group, quantifier, and special char)
3. Code snippet showing how to use it in [LANGUAGE] with test cases
4. Known limitations of the pattern
5. If the regex gets complex, suggest whether a parser might be more appropriate

How to use this prompt

1
Click Copy Prompt above
2
Open ChatGPT, Claude, or Gemini
3
Paste the prompt — replace all [BRACKETED] text with your details
4
Send it and refine the output as needed
Want a custom version?
Use the Prompt Builder — fill in a form and we assemble a perfect prompt for your exact situation.
Open Builder →