Groups | Search | Server Info | Login | Register


Groups > tw.bbs.comp.lang.python > #3

Python 3.11.0b4 中的正規表示式引擎的更新

Path csiph.com!aioe.org!mcIPSNtg2il4wHpazv38gQ.user.46.165.242.75.POSTED!not-for-mail
From Kang-min Liu <gugod@gugod.org>
Newsgroups tw.bbs.comp.lang.python
Subject Python 3.11.0b4 中的正規表示式引擎的更新
Date Wed, 20 Jul 2022 16:56:43 +0900
Organization Aioe.org NNTP Server
Message-ID <m1r12gw72c.fsf@gugod.org> (permalink)
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

Show key headers only | View raw


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/

Back to tw.bbs.comp.lang.python | Previous | Find similar


Thread

Python 3.11.0b4 中的正規表示式引擎的更新 Kang-min Liu <gugod@gugod.org> - 2022-07-20 16:56 +0900

csiph-web