Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.