Issue 433030: SRE: Atomic Grouping (?>...) is not supported (original) (raw)

Created on 2001-06-14 08:30 by effbot, last changed 2022-04-10 16:04 by admin.

Files
File name Uploaded Description Edit
issue2636-01.patch timehorse,2008-06-17 17:49
re_atomic_groups.patch serhiy.storchaka,2014-11-11 20:23 review
Pull Requests
URL Status Linked Edit
PR 31982 merged serhiy.storchaka,2022-03-18 19:00
Messages (12)
msg53164 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2001-06-14 08:30
from the jeffrey friedl report: (?>...) is not supported [this is a "stand-alone pattern". the engine has code for this, but the parser doesn't recognize this yet. shouldn't be too hard to fix; I just need a couple of good test cases before I start /F]
msg63284 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-03-05 16:17
Also referred to as an atomic group: see http://www.regular-expressions.info/atomic.html for a discussion. Fredrik, when you say "the engine has code for this", what do you mean?
msg63288 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-03-05 16:33
There's also an alternate syntax for this, called possessive quantifiers: a*+, a++, a{m,n}+.
msg64634 - (view) Author: Jeffrey C. Jacobs (timehorse) Date: 2008-03-28 12:39
Fredrik, If you're still listening, I am gonna try and tackle this one but I would like to know why you or the famous Jeffrey of the Regexp world claims that there is already code in the Regexp Engine for Atomic Grouping? Adding a hook for (?>...) should be trivial but I don't wanna re-invent the wheel if the proper stack-unwind code already exists. Thanks. Of course, Andrew (a.k.a. A.M. Kuchling) already asked this question and you did not answer it, so I guess you're not reading this, but if you are, please respond. Thanks!
msg64735 - (view) Author: Jeffrey C. Jacobs (timehorse) Date: 2008-03-29 23:08
I'm digging into the sre_parse.py at the moment and this I have all the changes I need for that now. The rest of the changes I believe are in either sre_compile.py or more likely directly in _sre.c, so I will examine those files next. I am attaching a single diff for expedience. This is not an official patch, just a sample to see the progress I am making. I forgot the correct format for patch files but I promise to get it right when I have made more progress.
msg65777 - (view) Author: Jeffrey C. Jacobs (timehorse) Date: 2008-04-25 10:53
Quick update (see thread 2636 for other updates to the Regex functionality): I do have a design in my mind for how to accomplish both Atomic Grouping and Possessive Qualifiers and it would work with either the existing Engine design or the new design I have been playing with. It's just a matter of getting around to implementing it, testing it and documenting it. I currently am having problem with Bazaar / Launchpad which are beyond the scope of this issue but are effecting my work. Those issues can be found on the Launchpad site if you look for Answers / Bugs originating from "timehorse".
msg68337 - (view) Author: Jeffrey C. Jacobs (timehorse) Date: 2008-06-17 17:49
I have finished work on the Atomic Grouping / Possessive Qualifiers support and am including a patch to achieve this; however, http://bugs.python.org/issue2636 should be consulted for the complete list of changes in the works for the Regexp engine.
msg113201 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-07 20:53
Does the re2 work (#2636) make this outdated?
msg114621 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-22 00:06
Implemented in #2636.
msg231041 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-11 19:17
Some unrelated to the topic changes from the patch are committed in 30a6c74ad87f.
msg231049 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-11 20:23
Reopened because definitely regex will be not adopted in 3.5. Here is updated to 3.5 Jeffrey's patch.
msg415685 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-03-21 16:28
New changeset 345b390ed69f36681dbc41187bc8f49cd9135b54 by Serhiy Storchaka in branch 'main': bpo-433030: Add support of atomic grouping in regular expressions (GH-31982) https://github.com/python/cpython/commit/345b390ed69f36681dbc41187bc8f49cd9135b54
History
Date User Action Args
2022-04-10 16:04:07 admin set github: 34627
2022-03-21 16:28:37 serhiy.storchaka set messages: +
2022-03-19 10:39:28 serhiy.storchaka set priority: low -> normalnosy: + mrabarnett
2022-03-19 08:45:54 AlexWaygood set versions: + Python 3.11, - Python 3.5
2022-03-18 19:29:33 rhettinger set assignee: effbot ->
2022-03-18 19:00:09 serhiy.storchaka set pull_requests: + <pull%5Frequest30072>
2015-03-17 18:35:09 abacabadabacaba set nosy: + abacabadabacaba
2015-03-02 08:57:59 ezio.melotti set nosy: + ezio.melotti
2014-12-31 16🔞38 akuchling set nosy: - akuchling
2014-12-24 11:57:53 THRlWiTi set nosy: + THRlWiTi
2014-11-11 20:23:03 serhiy.storchaka set status: closed -> openfiles: + re_atomic_groups.patchversions: + Python 3.5, - Python 3.2messages: + resolution: duplicate ->
2014-11-11 19:17:05 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2010-08-22 00:06:24 georg.brandl set status: open -> closednosy: + georg.brandlmessages: + resolution: duplicate
2010-08-07 20:53:30 terry.reedy set versions: + Python 3.2, - Python 2.6nosy: + terry.reedymessages: + stage: patch review
2008-06-17 17:49:20 timehorse set files: - PyLibDiffs.txt
2008-06-17 17:49:08 timehorse set files: + issue2636-01.patchkeywords: + patchmessages: +
2008-04-25 10:53:54 timehorse set messages: +
2008-04-24 21:06:35 rsc set nosy: + rsc
2008-03-29 23:08:52 timehorse set files: + PyLibDiffs.txtmessages: + components: + Library (Lib)versions: + Python 2.6
2008-03-28 12:40:52 timehorse set title: SRE: (?>...) is not supported -> SRE: Atomic Grouping (?>...) is not supported
2008-03-28 12:40:03 timehorse set messages: +
2008-03-27 17:25:27 timehorse set nosy: + timehorse
2008-03-05 16:33:40 akuchling set messages: +
2008-03-05 16:17:53 akuchling set nosy: + akuchlingmessages: +
2001-06-14 08:30:56 effbot create