Hugo van Kemenade proposes soft-deprecating re.match() in Python's re module, explaining that its behavior of only matching at the beginning of a string is often surprising to developers. The post introduces the soft deprecation concept from PEP 387 and recommends re.search() as a replacement for matching anywhere in a string.
Background
Python's re module has long had three matching functions: re.match(), re.search(), and re.fullmatch(), with subtle behavioral differences that often confuse developers.
- Source
- Lobsters
- Published
- Sep 11, 2026 at 05:59 AM
- Score
- 6.0 / 10