How to remove every line that doesn't contain special/specific characters in Notepad++

Viewed 19

I would like the remove every line that doesn't contain the next characters:

! ? # * $ [ ] { } - _ ( )

How should I do that, please?

1 Answers
  • Find what: ^[^!?#*$\[\]{}\-_()]+\R?
  • Replace with: LEAVE EMPTY

[^!?#*$\[\]{}\-_()] is a negative character class that match a character that is not !, ?, #, *, $, [, ], {, }, -, _, ( or )

Related