This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark
Recipients akuchling, amaury.forgeotdarc, jimjjewett, mark, pitrou, rsc, timehorse
Date 2008-06-18.07:13:14
SpamBayes Score 0.00808991
Marked as misclassified No
Message-id <>
In-reply-to <>
> 13) Implement a grouptuples(...) method as per Mark Summerfield's
> suggest on 2008-05-28 09:38.  grouptuples would take the same filtering
> parameters as the other group* functions, and would return a list of 3-
> tuples (unless only 1 group was requested).  It should default to all
> match groups (1..n, not group 0, the matching string).


> Finally, I would like suggestions on how to handle name collisions when
> match group names are provided as attributes.  For instance, an
> expression like '(?P<pos>.*)' would match more or less any string and
> assign it to the name "pos".  But "pos" is already an attribute of the
> Match object, and therefore pos cannot be exposed as a named match group
> attribute, since match.pos will return the usual meaning of pos for a
> match object, not the value of the capture group names "pos".
> I have 3 proposals as to how to handle this:
> a) Simply disallow the exposure of match group name attributes if the
> names collide with an existing member of the basic Match Object
> interface.

I don't like the prefix ideas and now that you've spelt it out I don't
like the sometimes will work and sometimes it won't. So I prefer
m['foo'] to be the canonical way because that guarantees your code is
always consistent.

BTW I wanted to do a simple regex to match a string that might or might
not be quoted, and that could contain quotes (but not those used to
delimit it). My first attempt was illegal:


It isn't hard to work round but it did highlight the fact that you can't
use captures inside character classes. I don't know if Perl allows this;
I guess if it doesn't then Python shouldn't either since GvR wants the
engine to be Perl compatible.
Date User Action Args
2008-06-18 07:13:27marksetspambayes_score: 0.00808991 -> 0.00808991
recipients: + mark, akuchling, jimjjewett, amaury.forgeotdarc, pitrou, rsc, timehorse
2008-06-18 07:13:25marklinkissue2636 messages
2008-06-18 07:13:23markcreate