Re: [Tutor] uncomprehension on RE

2007-09-20 Thread cedric briner
Stephen Nelson-Smith wrote: > On 9/20/07, cedric briner <[EMAIL PROTECTED]> wrote: > >> To let you know, I'm writing a script to generate bind9 configuration >> from a nis hosts table. So I was trying in a one re to catch from this: >> >> [ ...] [# comment] >> e.g: >> 10.12.23.45 hostname1 alia

Re: [Tutor] uncomprehension on RE

2007-09-20 Thread cedric briner
Kent Johnson wrote: > cedric briner wrote: >> To let you know, I'm writing a script to generate bind9 configuration >> from a nis hosts table. So I was trying in a one re to catch from this: >> >> [ ...] [# comment] >> e.g: >> 10.12.23.45 hostname1 alias1 alias2 alias3 # there is a nice comment

Re: [Tutor] uncomprehension on RE

2007-09-20 Thread Kent Johnson
cedric briner wrote: > To let you know, I'm writing a script to generate bind9 configuration > from a nis hosts table. So I was trying in a one re to catch from this: > > [ ...] [# comment] > e.g: > 10.12.23.45 hostname1 alias1 alias2 alias3 # there is a nice comment > 37.64.86.23 hostname2 >

Re: [Tutor] uncomprehension on RE

2007-09-20 Thread Luke Paireepinart
Stephen Nelson-Smith wrote: > On 9/19/07, cedric briner <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I do not understand the behaviour of this: >> >> import re >> re.search('(a)*','aaa').groups() >> ('a',) >> >> I was thinking that the ``*'' will operate on the group delimited by the >> parenthe

Re: [Tutor] uncomprehension on RE

2007-09-20 Thread Stephen Nelson-Smith
On 9/20/07, cedric briner <[EMAIL PROTECTED]> wrote: > To let you know, I'm writing a script to generate bind9 configuration > from a nis hosts table. So I was trying in a one re to catch from this: > > [ ...] [# comment] > e.g: > 10.12.23.45 hostname1 alias1 alias2 alias3 # there is a nice com

Re: [Tutor] uncomprehension on RE

2007-09-19 Thread cedric briner
Kent Johnson wrote: > cedric briner wrote: >> Hello, >> >> I do not understand the behaviour of this: >> >> import re >> re.search('(a)*','aaa').groups() >> ('a',) >> >> I was thinking that the ``*'' will operate on the group delimited by the >> parenthesis. And so, I was expecting this result: >>

Re: [Tutor] uncomprehension on RE

2007-09-19 Thread Stephen Nelson-Smith
On 9/19/07, cedric briner <[EMAIL PROTECTED]> wrote: > Hello, > > I do not understand the behaviour of this: > > import re > re.search('(a)*','aaa').groups() > ('a',) > > I was thinking that the ``*'' will operate on the group delimited by the > parenthesis. And so, I was expecting this result: > (

Re: [Tutor] uncomprehension on RE

2007-09-19 Thread Kent Johnson
cedric briner wrote: > Hello, > > I do not understand the behaviour of this: > > import re > re.search('(a)*','aaa').groups() > ('a',) > > I was thinking that the ``*'' will operate on the group delimited by the > parenthesis. And so, I was expecting this result: > ('a', 'a', 'a') > > Is there

[Tutor] uncomprehension on RE

2007-09-19 Thread cedric briner
Hello, I do not understand the behaviour of this: import re re.search('(a)*','aaa').groups() ('a',) I was thinking that the ``*'' will operate on the group delimited by the parenthesis. And so, I was expecting this result: ('a', 'a', 'a') Is there something I'am missing ? Ced. -- Cedric BR