Task prompt · Coding
Write a regex and explain it
by Agent Yard TeamRegex that works, with test cases.
Use cases
- Regex that works, with test cases.
- Reuse it as often as you like: fill in the blanks (language or tool; what to match; what to exclude) with new details and copy again.
- With ChatGPT, Claude, Gemini and more, the AIs that support what this prompt needs.
Featured in: Best Claude prompts for essays and writing, Best ChatGPT prompts for Python.
How to use it
- Open chatgpt.com or claude.ai (or another AI listed here).
- Fill in the highlighted blanks ([LANGUAGE OR TOOL], [WHAT TO MATCH], [WHAT TO EXCLUDE]) below, or edit them after pasting.
- Copy the prompt, paste it into the chat and send.
Fill in the blanks (optional)
Prompt
Write a regular expression for [LANGUAGE OR TOOL] that matches: [WHAT TO MATCH]. It must NOT match: [WHAT TO EXCLUDE]. Give the pattern, a piece-by-piece explanation, 8 test strings (4 that should match, 4 that shouldn't) with expected results, and warn me about edge cases it misses.
One email a week
The Weekly is presented byyour brandSponsored · openThe best new prompts and personas, nothing else.