I am using replace-regexp
interactively. Can I programmatically refer to a match or otherwise interpolate values in the replacement string? In Ruby, for example, it is easily done, by using the #{ <code> }
syntax.
For example: Lets say that I have a string which looks like "GClass::DhF"
. I want to remove the substring "::Dh"
, replace it with whitespace, and convert to a lowercase the first character that appears after "Dh"
. So, for example, "GClass::DhF"
will be converetd to "GClass f"
, and "GClass::DhY"
will be converted to "GClass y"
. The idea is that instead of inputting GClass \1
, I input what in LISP would be (strcat "GClass " (lowercaseString \1))
.