Thursday 8 January 2015

IntelliJ find and replace: How to remove all lines not containing a certain text

This is essentially just an exercise in Regex but it's a little tricky (at least I found it non-trivial).

Supposing you want to remove all lines not containing xxx this is how you would go about it.

In the find box type: 

^((?!xxx).)*\n

and just leave the replace box empty. 



8 comments:

  1. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    webstorm-activation-Free Download

    ReplyDelete
  2. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    In the content!
    vstkey.com
    PhpStorm Crack

    ReplyDelete

  3. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost

    the past 6 years, but I had no idea of solving some basic issues. I do not know how to

    Download Cracked Pro Softwares
    But thankfully, I recently visited a website named Crack Software Free Download
    All Pro Cracked Softwares Download
    PhpStorm Crack

    ReplyDelete