Re: [Tutor] how to print the match middle part out

2011-12-15 Thread Steven D'Aprano
lina wrote: Hi, For following: aaa model 0 bbb acb model 1 ccc How can I set regexp1 as "model 0" and end "model 1" In English, we have a saying "When all you have is a hammer, everything looks like a nail". Don't make the mistake of thinking that regexes are your hammer. In my opinion,

Re: [Tutor] how to print the match middle part out

2011-12-15 Thread Timo
Op 15-12-11 17:52, lina schreef: Hi, For following: aaa model 0 bbb acb model 1 ccc How can I set regexp1 as "model 0" and end "model 1" so the final print out will be: model 0 bbb acb Just iterate over the lines (file or string) and retrieve the lines from the wanted line, until the line

[Tutor] how to print the match middle part out

2011-12-15 Thread lina
Hi, For following: aaa model 0 bbb acb model 1 ccc How can I set regexp1 as "model 0" and end "model 1" so the final print out will be: model 0 bbb acb above is a very simple example, Thanks for any advice, Best, ___ Tutor maillist - Tutor@pyth