↓Skip to main content
Zeitgeist — a spike by Chris Gathercole
  1. Creators/
  2. Simon Willison — Creator of Datasette; co-creator of Django/

Soft-deprecating re.match()

Blog · Watch/Read · (gathered 2026-09-13)

  • Python’s re.match() function is being “soft-deprecated” in the upcoming Python 3.15 release due to its confusing behavior.
  • “Soft deprecation” is a Python concept where APIs are marked as unsuitable for new code without a threat of future removal.
  • The clearer alternative for re.match() is re.prefixmatch(), which accurately reflects its behavior of anchoring only at the beginning of a string.
  • For most common use cases, developers should likely use re.search() (to match a pattern anywhere in the string) or re.fullmatch() (to match the entire string) instead.