Article View: tw.bbs.comp.lang.python
Article #1Python 3.11.0b4 中的正規表示式引擎的更新
From: Kang-min Liu
Date: Wed, 20 Jul 2022 07:56
Date: Wed, 20 Jul 2022 07:56
17 lines
1801 bytes
1801 bytes
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/
Technical Details
Message-ID:
<m1r12gw72c.fsf@gugod.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <m1r12gw72c.fsf@gugod.org> Subject: Python 3.11.0b4 中的正規表示式引擎的更新 Date: Wed, 20 Jul 2022 16:56:43 +0900 From: Kang-min Liu <gugod@gugod.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: tw.bbs.comp.lang.python Organization: Aioe.org NNTP Server 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