Re: regex module, or don't work as expected

2006-07-04 Thread Fredrik Lundh
Fabian Holler wrote: > Yes thats right, but that isn't my problem. > The problem is in the "(?=(iface)|$)" part. no, the problem is that you're thinking "procedural string matching from left to right", but that's not how regular expressions work. > I have i.e. the text: > > "auto lo eth0 > ifa

Re: regex module, or don't work as expected

2006-07-04 Thread Fabian Holler
Hello Marc, thank you for your answer. Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Fabian Holler wrote: >> i have the following regex "iface lo[\w\t\n\s]+(?=(iface)|$)" >> >> If "iface" don't follow after the regex "iface lo[\w\t\n\s]" the rest of >> the text should be selected. >

Re: regex module, or don't work as expected

2006-07-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Fabian Holler wrote: > Howdy, > > > i have the following regex "iface lo[\w\t\n\s]+(?=(iface)|$)" > > If "iface" don't follow after the regex "iface lo[\w\t\n\s]" the rest of > the text should be selected. > But ?=(iface) is ignored, it is always the whole texte selected

regex module, or don't work as expected

2006-07-04 Thread Fabian Holler
Howdy, i have the following regex "iface lo[\w\t\n\s]+(?=(iface)|$)" If "iface" don't follow after the regex "iface lo[\w\t\n\s]" the rest of the text should be selected. But ?=(iface) is ignored, it is always the whole texte selected. What is wrong? many thanks greetings Fabian -- http://m