יום שלישי, 15 בספטמבר 2026 LIVE
AI־INFO

כתבה Simon Willison ·

הפסקת תמיכה רכה ב re.match()

Soft-deprecating re.match()
Python מפסיקה לתמוך ב re.match() ומומלץ להשתמש ב re.prefixmatch() במקום. זה עוזר למנוע התקלות כאשר ניסיון להשתמש ב re.match() עם פטרנים שאינם נפתחים.
תקציר מקורי באנגלית<p><strong><a href="https://hugovk.dev/blog/2026/soft-deprecating-re.match/">Soft-deprecating re.match()</a></strong></p> Python has a concept of <a href="https://peps.python.org/pep-0387/#soft-deprecation">soft deprecation</a>, where APIs are marked as "should no longer be used to write new code" without any promise/threat to remove them in the future.</p> <p>Python 3.15 release manager Hugo van Kemenade describes how in the upcoming 3.15 release soft deprecation has come for the venerable but deeply confusing <code>re.match()</code> function. It's now available with the much clearer alternative <code>re.prefixmatch()</code> name - reflecting how it anchors at the beginning of the string but not the end.</p> <p>Most of the time you probably want <code>re.search()</code> (match this patter
קרא במקור המקורי