lp:~pythonregexp2.7/python/issue2636-02

Created by TimeHorse and last modified

Modification to the re.match class (internally _sre.SRE_MATCH) to support accessing the values of groups captured by name as if they were properties of the given match. In other words, support m.foo as valid shorthand for m.group('foo'). Because named groups are restricted to be valid python names in the current version of python, no existing group names would violate this format for addressing their capture.

Get this branch:
bzr branch lp:~pythonregexp2.7/python/issue2636-02
Members of Python Regexp 2.7 can upload to this branch. Log in for directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Python Regexp 2.7
Project:
Python
Status:
Development

Recent revisions

39034. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Merged in changes from the core Regexp branch.

39033. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Merged in changes from the core Regexp branch.

39032. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Added documentation for the named capture group identifier attributes,
but an attribute specified as ``group_identifier`` to denote it not to be
taken literally may not be the correct way to do so notationally.

39031. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Use PyString_FromString instead of Py_BuildValue as a more efficient way
to get a PyObject from a char *.

39030. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Added more test cases for a name collision ('pos'), trying to use a group
number ('1' or 1) and making sure a bad name still raises an exception.

39029. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Made the getatter handler of the Match object use else-if rather than
lots of 'if's since it seems cleaner; added first draft of named match
group attributes, but 2 issues remain: match.1 needs to be verified as
NOT working and secondly, how do I handle (?P<pos>...) because pos as
well as any other existing match group attributes have names that are
already reserved. Once those issues are resolved, I need to figure out
if there is a more efficient way to retrieve the match group since now
it has to construct a PyObject to search for the named group. Oh, and I
need to add in a test to make sure "bad names" return an exception as
normal.

39028. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Added two test cases to verify that the Named Match Group attribute is
available in a match instance with a named Match Group.

39027. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Merged in changes from the core Regexp branch.

39026. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Merged in changes from the core Regexp branch.

39025. By Jeffrey C. "The TimeHorse" Jacobs <email address hidden>

Merged in changes from the core Regexp branch.

Branch metadata

Branch format:
Branch format 6
Repository format:
Bazaar pack repository format 1 with rich root (needs bzr 1.0)
This branch contains Public information 
Everyone can see this information.

Subscribers

No subscribers.