Say I have a buffer which contains:
Hello
HELLO
and I run a regexp-replace going from \(.*\)
to \1 World!
The result is
Hello World!
HELLO WORLD!
While what I want is
Hello World!
HELLO World!
Is there an option somewhere I can set to do this?
Set case-replace
to nil
, like this:
(setq case-replace nil)
Then it will preserve the case in the replace.
C-h f query-replace-regexp RET
精彩评论