Thread View: tw.bbs.comp.lang.python
1 messages
1 total messages
Started by Kang-min Liu
Wed, 20 Jul 2022 07:56
Python 3.11.0b4 中的正規表示式引擎的更新
Author: 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/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads