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.

link|improve this question

63% accept rate
feedback

1 Answer

up vote 4 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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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