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. >> But ?=(iface) is ignored, it is always the whole texte selected. >> What is wrong? > > The ``+`` after the character class means at least one of the characters > in the class or more. If you have a text like: Yes thats right, but that isn't my problem. The problem is in the "(?=(iface)|$)" part. I have i.e. the text: "auto lo eth0 <MATCH START>iface lo inet loopback bla blub <MATCH END>iface eth0 inet dhcp hostname debian" My regex should match the marked text. But it matchs the whole text starting from iface. If there is only one iface entry, the whole text starting from iface should be matched. greetings Fabian -- http://mail.python.org/mailman/listinfo/python-list