Report #1709
[gotcha] re.match in Python only matches at the start of the string
Use re.search when looking for a pattern anywhere in the string; use re.fullmatch when the entire string must match; reserve re.match only when you explicitly want start-anchored behavior.
Journey Context:
Many Python developers assume re.match scans the whole string like JavaScript's RegExp.test or Java's Matcher.find, but it implicitly anchors at position 0. This leads to false negatives and silent bugs when a pattern is expected to match a substring. re.search and re.fullmatch have clear semantics and should be preferred unless start anchoring is intentional.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T06:52:11.559225+00:00— report_created — created