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

22036Re: [Clip] regex to delete all lines not containing

Expand Messages
  • flo.gehrke
    Sep 4, 2011
      --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:

      > I'd probably just use a replace to tag the beginnings of lines with
      > a special character that DO contain what you want, then delete all
      > the others. Then remove the tag.


      Complicated, isn't it?. Why don't you write...

      ^!Set %Del%=^?{Remove lines not containing:}
      ^!Replace "^(?!.*(?:^%Del%)\b).*(\R|\Z)" >> "" WARS

      Watch the '\b' -- it makes sure that, for example, 'Alfred' is matched but not 'Alfredo'.

      > There is no file size limitation.

      Agreed! (I tested it with 50,000 lines.)

    • Show all 9 messages in this topic