classification
Title: SRE: Atomic Grouping (?>...) is not supported
Type: feature request Stage:
Components: Library (Lib), Regular Expressions Versions: Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: effbot Nosy List: akuchling, effbot, rsc, timehorse (4)
Priority: low Keywords patch

Created on 2001-06-14 08:30 by effbot, last changed 2008-06-17 17:49 by timehorse.

Files
File name Uploaded Description Edit Remove
issue2636-01.patch timehorse, 2008-06-17 17:49
Messages (7)
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.
History
Date User Action Args
2008-06-17 17:49:20timehorsesetfiles: - PyLibDiffs.txt
2008-06-17 17:49:08timehorsesetfiles: + issue2636-01.patch
keywords: + patch
messages: + msg68337
2008-04-25 10:53:54timehorsesetmessages: + msg65777
2008-04-24 21:06:35rscsetnosy: + rsc
2008-03-29 23:08:52timehorsesetfiles: + PyLibDiffs.txt
messages: + msg64735
components: + Library (Lib)
versions: + Python 2.6
2008-03-28 12:40:52timehorsesettitle: SRE: (?>...) is not supported -> SRE: Atomic Grouping (?>...) is not supported
2008-03-28 12:40:03timehorsesetmessages: + msg64634
2008-03-27 17:25:27timehorsesetnosy: + timehorse
2008-03-05 16:33:40akuchlingsetmessages: + msg63288
2008-03-05 16:17:53akuchlingsetnosy: + akuchling
messages: + msg63284
2001-06-14 08:30:56effbotcreate