issue2636-03 : Code : Python (original) (raw)
lp:~pythonregexp2.7/python/issue2636-03
Created byTimeHorse on 2008-04-26 and last modifiedon 2008-09-26
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 branchlp:~pythonregexp2.7/python/issue2636-03
Branch merges
Related bugs
Related blueprints
Branch information
Recent revisions
39029. ByJeffrey C. "The TimeHorse" Jacobs on 2008-09-21
39028. ByJeffrey C. "The TimeHorse" Jacobs on 2008-06-18
39027. ByJeffrey C. "The TimeHorse" Jacobs on 2008-06-11
39026. ByJeffrey C. "The TimeHorse" Jacobs on 2008-06-09
39025. ByJeffrey C. "The TimeHorse" Jacobs on 2008-05-24
39024. ByJeffrey C. Jacobs on 2008-04-27
39023. ByJeffrey C. Jacobs on 2008-04-27
39022. ByJeffrey C. Jacobs on 2008-04-25
39021. Byarmin.rigo on 2008-04-25
39020. Byneal.norwitz on 2008-04-25
Branch metadata
Branch format:
Branch format 6
Repository format:
Bazaar pack repository format 1 with rich root (needs bzr 1.0)