Re: [Tutor] Regular expression oddity

2008-11-23 Thread spir
bob gailer a écrit : Emmanuel Ruellan wrote: Hi tutors! While trying to write a regular expression that would split a string the way I want, I noticed a behaviour I didn't expect. re.findall('.?', 'some text') ['s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't', ''] Where does the last

Re: [Tutor] Regular expression oddity

2008-11-22 Thread bob gailer
Emmanuel Ruellan wrote: Hi tutors! While trying to write a regular expression that would split a string the way I want, I noticed a behaviour I didn't expect. re.findall('.?', 'some text') ['s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't', ''] Where does the last string, the empty one

[Tutor] Regular expression oddity

2008-11-22 Thread Emmanuel Ruellan
Hi tutors! While trying to write a regular expression that would split a string the way I want, I noticed a behaviour I didn't expect. >>> re.findall('.?', 'some text') ['s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't', ''] Where does the last string, the empty one, come from? I find this behaviour r