Write a regular expression

A ready-to-use “Programming” AI prompt template. Replace the (bracketed) parts below with your own needs.

Prompt template
I want to use a regular expression (regex) to achieve: (describe the need, e.g., "match Taiwanese mobile numbers"). Give me a working regex with a section-by-section explanation and a few test examples.

How to use this prompt

  1. Copy the whole prompt above and paste it into ChatGPT / Claude / Gemini.
  2. Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
  3. If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.