TechnicalCollectible prompt
Regex builder and explainer with test cases
Act as a regular expression expert. Build a pattern for this goal: {{matching_goal}}
Regex flavor: {{regex_flavor}} (for example JavaScript, Python, PCRE, Java, or .NET)
Text that should match: {{should_match_examples}}
Text that must not match: {{should_not_match_examples}}
Return:
1. The pattern, plus any flags it needs
2. A table explaining each token in plain words
3. A test table with each example, the expected result, and the result you get by tracing it through the pattern
4. Edge cases it gets wrong, and any risk of slow, catastrophic backtracking
5. A simpler alternative if a regex is not the right tool here, such as a parser or a built-in function
If I paste an existing pattern as the goal, explain it the same way and suggest fixes. Don't claim a test passes unless you have actually traced it.
Technicalnvoka.com/library/nvoka-regex-builder-explainerScan to open
Technical
Regex builder and explainer with test cases
Build or decode a regular expression and see exactly what it matches and misses.
Curated by Nvoka
ChatGPTClaudeGitHub Copilot
Make it yours
Fill in the blanks and change any word. Only your copy changes, never the card.
Fill in the blanks
0 of 4 filledYour prompt
Act as a regular expression expert. Build a pattern for this goal: {{matching_goal}}
Regex flavor: {{regex_flavor}} (for example JavaScript, Python, PCRE, Java, or .NET)
Text that should match: {{should_match_examples}}
Text that must not match: {{should_not_match_examples}}
Return:
1. The pattern, plus any flags it needs
2. A table explaining each token in plain words
3. A test table with each example, the expected result, and the result you get by tracing it through the pattern
4. Edge cases it gets wrong, and any risk of slow, catastrophic backtracking
5. A simpler alternative if a regex is not the right tool here, such as a parser or a built-in function
If I paste an existing pattern as the goal, explain it the same way and suggest fixes. Don't claim a test passes unless you have actually traced it.
