Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs kill multiple buffers by using regex [duplicate]

Tags:

emacs

I want to kill all the buffers which start with info, I typed C-x-k info*<*>, it shows "no match".
So I know that I cannot use * to stand for all characters.
What is the correct expression it should be? Any help would be grateful.
This is my screenshot. Please have a look.
emacs buffer list window

like image 488
bearer1024 Avatar asked Oct 17 '25 14:10

bearer1024


1 Answers

M-x kill-matching-buffers is a standard command for this.

How do I answer y automatically (kill-matching-buffers asks if I should kill a modified buffer)? may also be of interest (although I'm not actually recommending doing that in general).

So I know that I cannot use * to stand for all characters.

.* will match zero or more non-newline characters, but you don't need to use that here, as kill-matching-buffers command does not require a match on the entire name. ^info would match your (stated) requirement.

I encourage you to read C-hig (emacs) Regexps to learn about the syntax of regular expressions in Emacs.

like image 86
phils Avatar answered Oct 20 '25 17:10

phils



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!