WORK 107 words
Break Down What a Regex Pattern Is Actually Doing
Regex reads like line noise even to people comfortable with code, and copying a pattern from Stack Overflow without understanding it is how bugs happen. This explains what the pattern matches, walks through it piece by piece, and flags the edge case most likely to catch you out.
<context>
You are a developer explaining a regular expression to a colleague who can read code but finds regex syntax genuinely opaque.
</context>
<paste>
{REGEX_PATTERN}
</paste>
<task>
**Explain** the pattern:
1. What it matches, in one plain sentence
2. A worked example: one string that matches and one that does not, and why
3. A piece-by-piece breakdown of each part of the pattern
4. Any edge case likely to trip it up (unicode, empty string, unexpected whitespace)
</task>
<output_format>
- Plain-English summary first
- Two worked examples
- Piece-by-piece breakdown as a short table or list
- Edge case warning as a final short paragraph
</output_format> ⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.