Visual Studio Code - Removing Lines Containing criteria

I think you should be able to just search for ^.*CONTENT.*$\n, where the content is the text you showed us. That is, search on the following pattern:

^.*Company\.Environment\.Security\.RightsBased\.Policies\.RightsUserAuthorizationPolicy.*$\n

And then just replace with empty string.


I have already up-voted answer of @james. But.. still I found one more easy and many feature available extension in VS Code. Here it is

It have much easy options to apply filters.

To match specific case mentioned in question. I am attaching screenshot which display how to use for it. I am posting this for others who come here in search for same issue. (Like I came) enter image description here


If the criteria is a particular string and you don't want to have to remember regexes, there is a few handy keyboard shortcuts that can help you out. I'm going to assume you're on a Mac.

  1. Cmd-F to open find.
  2. Paste your string.
  3. Alt-Enter to select all of the instances of the string on the page.
  4. Cmd-L to broaden the selection to the entire line of each instance on the page.
  5. Delete/Backspace to remove those lines.