Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 I change Emacs so that the regexp search (instead of normal search) is the default?

I would like to be able to type C-s [0-9], for example, and it takes me to the next number. Then, press C-s again, and it takes me to the next number.

I tried this:

(global-set-key "\C-s" 'search-forward-regexp)

But the repeated pressing of C-s does not work. It does find the first occurrence, but to find the second you have to re-enter the regexp [0-9] after pressing C-s.

share|improve this question
up vote 5 down vote accepted

You're close - use isearch-forward-regexp - note the 'i'.

Found via 'C-h k C-M-s' which is bound to interactive regexp search forward.

share|improve this answer

Your Answer


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.