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

How to delete lines which do not contains a particular string?

Expand Messages
  • hans.deragon@visa.desjardins.com
    Greetings. I would like to delete within vim all lines which would not match a regular expression pattern. Something like :g/!one +string/d (but off course,
    Message 1 of 1 , Jun 29, 2001
    • 0 Attachment
      Greetings.

      I would like to delete within vim all lines which would not match a regular expression
      pattern. Something like :g/!one +string/d (but off course, bang does not work here;
      I do not know the syntax and this is why I am posting).

      Specifically, I want to delete all lines which do not have an "=" sign. But I would like
      to have a more generic receipe which would involve regex patterns.


      Thanks,
      Hans Deragon
    Your message has been successfully submitted and would be delivered to recipients shortly.