Soft-deprecating re.match()
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Python 3.15 softly deprecates re.match() in favor of the clearer re.prefixmatch(), so developers writing new regex code should switch to re.search(), re.fullmatch() or re.prefixmatch().
Python, the popular programming language, is gently discouraging use of one of its oldest tools for pattern matching in text: re.match(). In the upcoming version 3.15, it is marked as 'softly deprecated', meaning new code should avoid it, though it will not be removed. Its behavior, matching a pattern at the start of a string but not the end, confuses many people, so a clearer replacement named re.prefixmatch() is being added. This affects anyone writing new Python code; existing code keeps working.
Python 3.15 will 'softly deprecate' re.match(), a long-standing standard-library function, meaning teams should stop using it in new code but nothing will be removed. Release manager Hugo van Kemenade is adding re.prefixmatch() as a clearer alternative, since re.match() anchors at the start of a string but not the end and routinely confuses developers. No migration cost exists; the practical impact is a style change, not a compatibility risk.
Python 3.15 soft-deprecates re.match(), following the PEP-style soft deprecation concept where an API is documented as unsuitable for new code with no removal promised. The replacement is re.prefixmatch(), a name that accurately reflects its anchoring semantics: it matches at the beginning of the string but not the end. The article notes re.search() (match anywhere) and re.fullmatch() (match the entire string) are what most code actually wants. No timeline for any removal is given.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Python re.match() re.prefixmatch() re.search() re.fullmatch() Datasette
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Amazon launches AI office apps to challenge Microsoft and Google
Amazon’s new AI-first office suite could shift enterprise productivity tools, forcing Microsoft and Google to rethink collaboration features.
Self-hosted email, calendar, booking, and Drive on Cloudflare or Docker
Self-hosted email, calendar, booking and file storage can cut monthly costs from hundreds to a few dollars, freeing budgets for other business needs.
Coding agents shouldn't grade their own work, so zeroshot runs your process as a graph
Separating code writing from review forces agents to follow a repeatable process, reducing false positives and saving developers time on debugging.
A Switch 2 emulator in C++, derived from Eden, Yuzu and Sudachi
A free, cross-platform Switch 2 emulator lets developers test and contribute to console emulation, potentially accelerating game preservation and research.
A benchmark that tracks whether AI relay stations silently downgrade models
If you rely on third-party AI relays, you may unknowingly pay for a higher-tier model while receiving a downgraded version, hurting performance and cost control.