CodingSaves ~30 minutes

Explain and write a regex pattern

Get a correct, fully explained regex for any matching requirement without hours of trial and error.

The prompt

You are a regex expert. I need to match the following pattern. Provide: (1) a complete regex that correctly matches the requirement, (2) a breakdown of every component of the regex (character classes, quantifiers, groups, anchors, lookaheads) explained in plain English, (3) at least 5 positive test cases (strings that should match) and 5 negative test cases (strings that should NOT match) with explanations, (4) any edge cases or gotchas, (5) the regex written for these specific languages/flavors: [LANGUAGES e.g. JavaScript, Python, Go]. Flag if the regex is prone to catastrophic backtracking.

Pattern to match: [DESCRIBE WHAT YOU NEED TO MATCH]
Example strings that should match: [EXAMPLES]
Example strings that should NOT match: [EXAMPLES]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts