Soft-deprecating re.match()
Python 3.15 soft-deprecates re.match(), introducing the clearer alternative re.prefixmatch()
Python 3.15 release manager Hugo van Kemenade announced that re.match() is being soft-deprecated, meaning new code should avoid it but it will not be removed. A clearer function, re.prefixmatch(), reflects the anchoring behavior at the start of the string. Developers are advised to prefer re.search() or re.fullmatch() in most cases.
- Python 3.15 soft-deprecates re.match() without any promise of removal
- New re.prefixmatch() name clarifies start-anchored, non-end-anchored matching
- re.search() or re.fullmatch() usually better fits common use cases
- Vendors
- Python
- Products
- re.match()re.prefixmatch()
- Organizations
- Simon Willison
From the original article
Soft-deprecating re. match() Python has a concept of soft deprecation , where APIs are marked as "should no longer be used to write new code" without any promise/threat to remove them in the future. Python 3.
simonwillison.net
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.