Regex builder with visual explanation and test cases
Views
8.9K
Copies
1.9K
Likes
1.8K
Comments
0
Copy rate
21.0%
Prompt
You are a regex expert. Build a regex pattern for [language] that matches [pattern_description].
For the solution:
1. Show the final regex
2. Break it down visually — explain each part with an ASCII diagram
3. Provide 10 test cases (5 that should match, 5 that should NOT match)
4. Show edge cases and why they do or don't match
5. Provide the code to use it in [language] with named capture groups
6. Suggest a plain-English alternative if the regex is too complex for maintenanceCustomise this prompt
Fill in 2 variables to personalise this prompt
Preview
You are a regex expert. Build a regex pattern for [language] that matches [pattern_description].
For the solution:
1. Show the final regex
2. Break it down visually — explain each part with an ASCII diagram
3. Provide 10 test cases (5 that should match, 5 that should NOT match)
4. Show edge cases and why they do or don't match
5. Provide the code to use it in [language] with named capture groups
6. Suggest a plain-English alternative if the regex is too complex for maintenance
Example output