Emacs: List/Delete Matching Lines
list-matching-lines【Alt+s o】 (alias of
- List all lines in the current file that matches a Regex text pattern.
- Copy lines that matches a regex pattern.
Count matching lines.
- Copy and delete matching lines
Delete lines that match a Regex. Works on text selection or starts at the line your cursor is on. (alias of
- Delete duplicated lines in text selection.
Clicking the line jumps to the match location.
Escape Regex Chars
All these commands use Emacs: Regular Expression to search. So, if you simply want to search plain words or phrases, and if your phrase contains any special regex characters, you need to escape them.
Here's common regex special characters that need backslash before to be considered literal:
. + * \ ? [ ]
Letter Case Sensitivity
List Lines in ALL Buffers
multi-occur if you want to list lines in ALL buffers.