Domanda

What is the quickest way to replace multiple characters at once in emacs? For instance I would like to act on the region and replace 1 with a, 2 with b, ..., 9 with i.

È stato utile?

Soluzione

You can stitch elisp into regex replacements (not sure if you can do the same with replace-string). For instance,

M-x query-replace-regexp \([1-9]\) \,(char-to-string (+ 96 \#1))

should replace single digits 1-9 with the letters a-i as appropriate.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top