regex with negative matching (ie, find string that _doesn’t_ match regex) January 3, 2024 by Tarik Use the :g! command to delete every line that doesn’t match. :g!/ERROR/d