[issue15956] backreference to named group does not work

2013-10-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset bee2736296c5 by Georg Brandl in branch '2.7': Closes #15956: improve documentation of named groups and how to reference them. http://hg.python.org/cpython/rev/bee2736296c5 -- nosy: +python-dev resolution: - fixed stage: patch review -

[issue15956] backreference to named group does not work

2013-10-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset f765a29309d1 by Georg Brandl in branch '3.3': Closes #15956: improve documentation of named groups and how to reference them. http://hg.python.org/cpython/rev/f765a29309d1 -- ___ Python tracker

[issue15956] backreference to named group does not work

2013-10-06 Thread Georg Brandl
Georg Brandl added the comment: Thanks for the patch. I made a few changes, such as explaining what the example pattern does. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15956

[issue15956] backreference to named group does not work

2012-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: I read it as a 'native speaker' and it looks fine to me. Table is clear, but I will let doc stylist decide. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15956

[issue15956] backreference to named group does not work

2012-09-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: And why isn't \ggroupname part of the pattern language, anyway, or at least some way to refer to a match made in a previous *named* group? But this way exists: (?P=startquote) is what you want. To me \g is an exception, and frankly I did not know

[issue15956] backreference to named group does not work

2012-09-18 Thread Matthew Barnett
Matthew Barnett added the comment: There needed to be a way of referring to named groups in the replacement template. The existing form \groupnumber clearly wouldn't work. Other regex implementations, such as Perl, do have \g and also \k (for named groups). In my implementation I added

[issue15956] backreference to named group does not work

2012-09-18 Thread Steve Newcomb
Steve Newcomb added the comment: But this way exists: (?P=startquote) is what you want. I know how I missed it: I searched for backref in the documentation. I did not find it in the discussion of the pattern language, because that word does not appear where ?P= is discussed. contributions

[issue15956] backreference to named group does not work

2012-09-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Thanks for the patch! The new formulation looks much better, but I'll let a native speaker have another check. Some comments: I preferred the previous example id because it's not obvious what \042\047 is. And a bullet list would be less heavyweight

[issue15956] backreference to named group does not work

2012-09-18 Thread Steve Newcomb
Steve Newcomb added the comment: I preferred the previous example id because it's not obvious what \042\047 is. Yeah, but the example I wrote has an in-pattern backreference and a real reason to use one. In the attached patch, I have changed [\042\047] to [\'\]. That's certainly clearer

[issue15956] backreference to named group does not work

2012-09-18 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- assignee: - docs@python nosy: +docs@python stage: committed/rejected - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15956

[issue15956] backreference to named group does not work

2012-09-18 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15956 ___ ___

[issue15956] backreference to named group does not work

2012-09-17 Thread Steve Newcomb
New submission from Steve Newcomb: The '\\gstartquote' in the below does not work: repr( re.compile( '!ENTITY[ \\011\\012\\015]+\\%[ \\011\\012\\015]*(?PentityName[A-Za-z][A-Za-z0-9\\.\\-\\_\\:]*)[ \\011\\012\\015]*(?Pstartquote[\\042\\047])(?PentityText.+?)\\gstartquote[

[issue15956] backreference to named group does not work

2012-09-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: \g is meant to be used in re.sub(), in the replacement text (see the docs); in the search pattern, (?P=startquote) can be used to refer to a named group. The docs of (?Pname...) looks clear to me. -- nosy: +amaury.forgeotdarc resolution: -

[issue15956] backreference to named group does not work

2012-09-17 Thread Steve Newcomb
Steve Newcomb added the comment: I have re-read the documentation on re.sub(). Even now, now that I understand that the \ggroupname syntax applies to the repl argument only, I cannot see how the documentation can be understood that way. The paragraph in which the explanation of the