ELSEIF
Your brief EB
296 stories from 182 feeds 1170 clusters Refreshed 13 minutes ago next pull 18:00

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.

WHY IT MATTERS

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 source

The three things worth knowing

01

re.match() only matches at the beginning of a string, which can be surprising to readers.

02

Python 3.15 adds re.prefixmatch() as an explicit alias for the same half-anchored behavior.

03

re.match() is soft-deprecated: it remains functional and documented, but new code should prefer re.prefixmatch(), re.search(), or re.fullmatch().

THE CLUSTER

Same story, 2 feeds.

ORDERED BY FIRST SEEN
hugovk.dev via Lobsters Soft-deprecating re.match() Open ↗
Simon Willison Soft-deprecating re.match() Open ↗