Advanced Code Reading #regex #code-review #documentation

🔍 Describing Regular Expressions

2 exercises — read a regex pattern and choose the most accurate, useful English description. Critical for code reviews, QA handoffs, and technical documentation.

0 / 2 completed
How to describe a regex in English
  • State the purpose first: "This pattern validates / matches / extracts…"
  • Describe what's required vs. optional in plain terms
  • Give concrete examples: "matches '2.0.0' but not '2.0'"
  • Mention anchors in plain English: "from start to end of the string"
  • Never just read the regex character by character — describe what it accepts
1 / 2
A senior developer asks you to explain what this regex does in a code review. Which answer is the clearest?
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;