Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs add quotes around every word

I have a file and i want to add quotes around every word for example hello becomes "hello" So far i have tried this in emacs:

M-x query-replace-regexp [a-z]+ RET "\1" y

But it just deletes the word and leaves quotes.

like image 753
arbast Avatar asked Dec 08 '22 07:12

arbast


1 Answers

This is what you want:

M-x query-replace-regexp \(\<\w+\>\) RET "\1" y
like image 188
Drew Avatar answered Dec 10 '22 19:12

Drew