Just informationally, you can remove lines NOT containing a specific bit of text via finding it with the following method:
Say you want to match lines that DON’T contain abc. Then your search expression might be ^(?-s)(?!.*abc).*\R. If you replace with nothing when you run a replacement you effectively remove those lines.
Obviously you can replace abc with whatever you need. It doesn’t have to be constant text, it can be a regular expression of course.