Re: regular expression match collection

2005-02-04 Thread [EMAIL PROTECTED]
Thanks you... -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression match collection

2005-02-04 Thread P
[EMAIL PROTECTED] wrote: Hello, For example I have a string : "Halo by by by" Then I want to take and know the possition of every "by" how can I do it in python? [ match.start() for match in p.finditer("Helo by by by") ] see: http://mail.python.org/pipermail/python-list/2004-December/255013.html --

Re: regular expression match collection

2005-02-04 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hello, For example I have a string : "Halo by by by" Then I want to take and know the possition of every "by" how can I do it in python? I tried to use: p = re.compile(r"by") m = p.search("Helo by by by") print m.group() # result "by" print m.span() # result (5,7)

Re: regular expression match collection

2005-02-04 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > For example I have a string : "Halo by by by" > Then I want to take and know the possition of every "by" > how can I do it in python? > > I tried to use: > > p = re.compile(r"by") > m = p.search("Helo by by by") > print m.group() # result "by" > print m.span() # r

regular expression match collection

2005-02-04 Thread [EMAIL PROTECTED]
Hello, For example I have a string : "Halo by by by" Then I want to take and know the possition of every "by" how can I do it in python? I tried to use: p = re.compile(r"by") m = p.search("Helo by by by") print m.group() # result "by" print m.span() # result (5,7) How can I get the inf