Explain and rewrite a regex pattern
A regex someone else wrote (or you wrote six months ago) is often faster to replace than to actually read.
- Use it for
- Anyone who needs to understand an existing regex or port one to a different language's regex engine.
Regex is write-once, read-never for most people — a pattern that made sense while writing it becomes opaque within weeks, and porting one between languages' regex dialects (lookbehind support, escaping rules) isn't always a direct copy-paste. This prompt explains what a pattern actually matches piece by piece, then rewrites it for a different engine if needed.
When not to use this
If you're comfortable reading the pattern directly and just need a quick syntax check, this full explanation is more than you need.
Did this work?
You can explain in your own words what the pattern matches, and have a working equivalent in the target language if you needed one.
Tested on claude-opus-5. Evidence status is draft; it moves to battle-tested only on recorded runs, never by hand.