ThinkWithPrompt by SynotticThinkWithPrompt

Write and explain a regular expression

Builds a regex from a description, explains it piece by piece, and tests it.

Software DevelopmentRTFStandardCodingWriteRewrite & EditFill-in Template

The prompt

Write a regular expression for me. What it should match: [DESCRIPTION — e.g. "UK postcodes", "dates like 2026-03-14", "emails but not ones ending in .test"] Where I'll use it: [JavaScript / Python / PCRE / Java / Excel / a text editor] Should match: [EXAMPLES] Should NOT match: [EXAMPLES] Return: 1. The regex in a code block. 2. A piece-by-piece explanation. 3. A test table showing each of my examples and whether it matches. 4. Edge cases it doesn't handle, and a stricter or looser variant if useful. Prefer readable patterns over clever ones; note any flavor-specific syntax.

Highlighted [brackets] are blanks to replace with your own details.

Fill in the blanks and use this promptMore Software Development prompts

What to fill in

  • JavaScript / Python / PCRE / Java / Excel / a text editor
  • EXAMPLES

How this prompt is built

This prompt follows the RTF structure (Role, Task, Format). RTF tells the model who to be, what to do and what shape the answer should take. It is the quickest structure that still gives noticeably better results than a bare request.

Related prompts

Find more prompts like this