Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can you activate Emacs' kill-ring in Regex-builder?

My regex " [a-zA-z/0-9-.]*" hilights stuff which I want to be removed. I put the regex to kill ring by C-c C-w. I unsuccessfuly activate the delete -command by pressing SHIFT-CTRL-META-5 that is how I understand C-M-%, and then ENTER which gives replaced 0 occurances. I should apparently press ! somewhere.

Where do you press !?

share|improve this question
up vote 1 down vote accepted

I think the problem you are having is that C-c C-w copies the quoted regular expression and query-replace-regexp seems to only like raw regex.

For example

C-M-% "[a-z]+" RET test RET

does not work, but

C-M-% [a-z]+ RET test RET

does work.

I do not know what you are refering to when with the ! key; have you got the reference material that you are working to?

You will see the same problem defined here on StackOverflow with some ideas to solve the problem. Including a reference to re-builder+ which apparantly has some features which make it play nice with query-replace-regexp and the likes.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .