Path: csiph.com!aioe.org!mcIPSNtg2il4wHpazv38gQ.user.46.165.242.75.POSTED!not-for-mail From: Kang-min Liu Newsgroups: tw.bbs.comp.lang.python Subject: Python 3.11.0b4 =?utf-8?B?5Lit55qE5q2j6KaP6KGo56S65byP5byV5pOO?= =?utf-8?B?55qE5pu05paw?= Date: Wed, 20 Jul 2022 16:56:43 +0900 Organization: Aioe.org NNTP Server Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: gioia.aioe.org; logging-data="33453"; posting-host="mcIPSNtg2il4wHpazv38gQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin) Cancel-Lock: sha1:Gn5Nmma5U53TNNdIqQNXHfjZ72Y= X-Notice: Filtered by postfilter v. 0.9.2 Xref: csiph.com tw.bbs.comp.lang.python:3 https://pythoninsider.blogspot.com/2022/07/python-3110b4-is-now-available.html 在 2022/07/11 釋出的 Python 3.11.0b4 的更新概要中看到這一項關於正規表示 式的更新: - bpo-433030– Atomic grouping ((?>…)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions. (?>...) 這個語法是讓人要在手動避免回溯時使用的,一般而言是可以用來避免不 必要的回溯而降低延遲。這在 perl / pcre 中都已經出現一段時間了,如果 python 一直沒有跟著上新版 pcre ,那也未免太久了的感覺。稍微追查一下 [bpo-433030] 的內容,可看到這事項是在 2001 年被測出來,途中經過幾人貢獻 後,總算是在 2022 年正式出現在 python 裡面。 總共花了 21 年的才處理完畢的蟲。 [bpo-433030]: https://github.com/python/cpython/issues/34627/