Viết một biểu thức chính quy (Regex)

A ready-to-use “Lập trình” AI prompt template, designed and tested with ChatGPT. Replace the (bracketed) parts below with your own needs.

Prompt template
Hãy viết một biểu thức chính quy: 1) đưa ra regex theo nhu cầu; 2) phân tách nó, giải thích mỗi phần khớp gì; 3) cho 5 ví dụ khớp và 5 ví dụ không khớp; 4) chỉ ra các bẫy sai khớp phổ biến và một cách viết bền vững hơn.

Điều tôi muốn khớp: "mô tả quy tắc, ví dụ: số di động Việt Nam"
Ngôn ngữ sử dụng: "ví dụ: JavaScript"

How to use this prompt

  1. Copy the whole prompt above and paste it into ChatGPT or 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.

Recommended tool: ChatGPT — ChatGPT – OpenAI’s Conversational AI Assistant