Regexp

Home

Basics

See also https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html.

Examples

Replace comma with newline

C-q to escape, and C-j to insert newline character.

M-x replace-regexp RET , RET C-q C-j

Call elisp function on matched group

Use \, before function in the replacement string.

M-x replace-regexp RET ^"\([a-zA-Z]+\)"$ RET \,(upcase \1)("\1")) RET

Project maintained by tychobrailleur Hosted on GitHub Pages — Theme by mattgraham