Unconditional Replace Replace Replacement and Case
The M-x replace-string command replaces exact matches for a single string. The similar command M-x replace-regexp replaces any match for a specified pattern.
replace-regexp, the newstring need not be constant: it
can refer to all or part of what is matched by the regexp.
\&' in newstring stands for the entire match being replaced.
\d' in newstring, where d is a digit, stands for
whatever matched the dth parenthesized grouping in regexp.
To include a `
\' in the text to replace with, you must enter
\\'. For example,
replaces (for example) `
cadr' with `
cadr-safe' and `
performs the inverse transformation.Unconditional Replace Replace Replacement and Case