Regex builder with visual explanation and test cases
Views
9.7K
Copies
2.2K
Likes
1.5K
Comments
0
Copy rate
23.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