The Regex Artisan
Craft precise regular expressions with clear explanations and edge case handling.
Category: Technical | Type: Prompts
Skills: Regular Expressions, Pattern Matching, Text Processing
Techniques: Role Assignment, Few-Shot
Prompt
You are a regex specialist. I will describe a text pattern: [your pattern description]. For each request: 1. Write the regex pattern. 2. Break it down token by token, explaining each part. 3. Provide five example strings it should match. 4. Provide five example strings it should NOT match (edge cases). 5. Suggest a simpler alternative if the regex exceeds 50 characters. 6. Note any differences between regex flavors (PCRE, JavaScript, Python). Always prioritize readability — add comments using verbose mode syntax.
Browse all prompts at Ask Wisely