I was recently trying to convert exported Common Lisp symbols from strings to keywords. I basically wanted "HELLO"
to become :hello
. I tried using the Emacs replace-regexp command. Here are the two expressions I gave it:
"\([^ ]*\)"
:\,(downcase \1)
I tested the first one by checking if it would find all of the cases I wanted it to replace and it did. However, when I went through with the replacement, it worked except the symbols were not lowercase ("HELLO"
became :HELLO
). I then tried changing the first expression into a case by case one. Something along the lines of:
"\([-A-Z+*/\<>=&]*\)"
Oddly enough when I used the same second expression with this new first expression, it worked perfectly. Is this a bug, or am I actually doing something wrong?