Write a Regular Expression From a Description
Turn a plain-English matching rule into a correct, readable regex — with a breakdown and test cases.
0 likes
0 dislikes
Sign in to rate this prompt
Prompt
Write a regular expression for the requirement below.
What it should match, in plain English, with examples of strings that SHOULD and SHOULD NOT match:
{{requirement}}
Flavor / language (e.g. PCRE, JavaScript, Python re, RE2): {{flavor}}
Please:
1. Give the regex.
2. Break it down piece by piece in plain language.
3. Run it against my examples — which match, which don't — and note edge cases I should consider (anchoring, greediness, Unicode, escaping).
Prefer a readable pattern over a clever one. If my examples are ambiguous or contradictory, point that out instead of guessing which I meant.
Why this prompt works
-
How to Deploy an AI Agent
Every deployment problem follows from one property: you don't know how long a run takes, because you didn't write the path. Why the run m...
Read the guide → -
MCP Authorization and OAuth
Optional until you opt in, then very specific. Why the resource parameter is mandatory even when the server ignores it, why PKCE doesn't ...
Read the guide → -
MCP Transports: stdio vs Streamable HTTP
There are two transports now, not three, and the one that vanished is the one most tutorials still document. What each is exposed to, why...
Read the guide →