Code Room
Code reviewMediumcr-g283
Subject Regex recompileLevel Mid–Senior~16 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Python validator called once per inbound request to check an email-like field.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewpython
import re def is_valid_handle(value: str) -> bool:    pattern = re.compile(r"^[a-z0-9]([a-z0-9._-]{0,28}[a-z0-9])?$")    return pattern.match(value) is not None
Run or narrate your approach, then ask the coach.