msg53164 - (view) |
Author: Fredrik Lundh (effbot) *  |
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) *  |
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) *  |
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) *  |
Date: 2010-08-07 20:53 |
Does the re2 work (#2636) make this outdated? |
|
|
msg114621 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-08-22 00:06 |
Implemented in #2636. |
|
|
msg231041 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
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) *  |
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) *  |
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 |
|
|