TECH Signal 385 2 feeds carried it
re.match() soft-deprecated in Python 3.15, use re.prefixmatch() instead for prefix matches
Python 3.15 marks re.match() as a soft-deprecated alias and introduces the clearer re.prefixmatch() for half-anchored matches.
Existing code that calls re.match() will continue to run unchanged, but new code should adopt re.prefixmatch() to avoid the historic confusion of its start-of-string semantics. The change is documentation-only, so no runtime warnings appear, yet lint tools can be configured to ban the old name. Switching now improves code readability and aligns with Python’s “explicit is better than implicit” philosophy.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
re.match() only matches at the beginning of a string, which can be surprising to readers.
Python 3.15 adds re.prefixmatch() as an explicit alias for the same half-anchored behavior.
re.match() is soft-deprecated: it remains functional and documented, but new code should prefer re.prefixmatch(), re.search(), or re.fullmatch().
THE CLUSTER
↗