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

Created by TimeHorse and last modified

Add subscript operators and len and iteration semantics to the match object. Initially, the idea was to allow the use of subscript operators ([]) to access, get ranges of and slice a match object where index represents the value passed to group to obtain ordinal match groups. This, as a consequence, would imply the use of the __len__ property and iteration over a match object so those changes will also be attempted here. In other words, m.group(n) could be written m.group[n], where n could be a ordinal value (0, 1, 2, ...) or a named match string (e.g. 'foo'). Because m.group(0) returns the entire match, m[0] would also do so. However, this may not be desirable in all cases, so in addition to m[1:] being made valid, a new method, captures(self) will be added that will return an iterator suitable for iteration over JUST the capture groups.

Get this branch:
bzr branch lp:~pythonregexp2.7/python/issue2636-03
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

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

Merged in changes from the core Regexp branch.

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

Merged in changes from the core Regexp branch.

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.

39024. By Jeffrey C. Jacobs <email address hidden>

Merged in changes from Main Line

39023. By Jeffrey C. Jacobs <email address hidden>

Merged in changes from Main Branch

39022. By Jeffrey C. Jacobs <email address hidden>

Mainline merge

39021. By armin.rigo

A new crasher.

39020. By neal.norwitz

Fix typo (now -> no)

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.