Loading ...
Sorry, an error occurred while loading the content.

Re: Search expression spanning multiple lines

Expand Messages
  • fritzophrenic
    ... What about the @! zero-width match? Maybe something like this would work: /word1 %( %(word1 |word2 ) @! _. ) +word2
    Message 1 of 13 , Oct 31, 2008
    • 0 Attachment
      On Oct 30, 3:49 pm, Andy Wokula <anw...@...> wrote:
      > Andy Wokula schrieb:
      >
      > > On the pattern:
      > > IIUC, you want a match for
      > >     /MAIL FROM:\_.\{-}Winsock
      >
      > > that has to fail if "----------" is contained in the match.
      >
      > > You could try these patterns:
      > >     /MAIL FROM:\%(\%(----------\)\@!\_.\)\{-}Winsock
      > >     " at each position, make sure there is no match for ----------
      >
      > > or
      > >     /MAIL FROM:.*\%(\%(----------\)\@<!\n.*\)*.*Winsock
      >
      > of course better: '\{-}' instead of '*' :
      >     /MAIL FROM:.*\%(\%(----------\)\@<!\n.*\)\{-}.*Winsock
      >
      > >     " make sure there is no match for ---------- before a line break
      >
      > > Another (IMHO new!?) idea: check out the following pattern on the
      > > next sentence:
      > >     /A.\{-}\%(\zsA.*\)\@<=N
      >
      > Ok, this doesn't help on the problem, because /\@<= cannot look back
      > over line breaks.
      >
      > > As AlwAys these Are oNly A few suggestioNs.
      >
      > > Matches are "Are oN" and "A few suggestioN" (esp. the first match is
      > > interesting).
      >

      What about the \@! zero-width match? Maybe something like this would
      work:

      /word1\%(\%(word1\|word2\)\@!\_.\)\+word2
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.