split encloser

Inyeol Lee inyeol.lee at siimage.com
Fri Apr 11 20:55:37 CEST 2003


On Thu, Apr 10, 2003 at 05:53:53PM -0700, Chris wrote:
> Jason Tiller <jtiller at sjm.com> wrote in message news:<mailman.1049417184.1536.python-list at python.org>...
> 
> > 
> > Good luck!  I hope this pattern at least gives you a starting point
> > for implementing the split() in Python.
> > 
> > ---Jason
> > Sonos Handbell Ensemble
> 
> Jason, thanks a lot for the example and the explanation. I fired up
> Perl and it worked like a charm. Now to try and understand it!  I
> looked at stuff about Python regular expressions and there is
> something called finditer and findall that might be useful for parsing
> a string, but can't seem to find any documentation on them.

It's in Library Reference section 4.2.3. (I've checked this in 2.3a2
document, but It'll be there in 2.2 also.)

Brief summary for findall and finditer is;

findall returns list of matched string.
finditer returns iterator of match object. You can do a lot more than
findall since it supports all match object attributes.

Inyeol...





More information about the Python-list mailing list