Regex Builder Comment
Providing both valid and invalid examples lets Copilot generate a precise regex instead of an overly broad one. Starting the const declaration on the next line triggers inline completion with the full pattern.
// Build a regex that matches {{patternDescription}} // Valid examples: {{validExamples}} // Invalid examples (should NOT match): {{invalidExamples}} // Flags: {{flags}} // Return as a named const with a JSDoc comment explaining the pattern const {{regexName}}: RegExp =
Variables to customize
Why this prompt works
Providing both valid and invalid examples lets Copilot generate a precise regex instead of an overly broad one. Starting the const declaration on the next line triggers inline completion with the full pattern.
What you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
$ npm i -g @promptingbox/mcpUse Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.