help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to search a whole word in emacs?


From: Johan Bockgård
Subject: Re: How to search a whole word in emacs?
Date: Sat, 27 Oct 2007 11:45:12 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

"address@hidden" <address@hidden> writes:

> I need to search a whole word in a big file. For example, I need to
> search "Machine" but I don't need to know anything like
> "machine_state", "running_machine_state" etc. The search shall be case
> sensitive.
>
> I've tried C-s ret C-w Machine but it returns every word with
> "Machine" in it. I just need the exact word.

`running_machine_state' usually counts as a symbol consisting of three
words. You need to search for symbol, not word, boundaries (works only
in Emacs >= 22):

    C-M-s \_<Machine\_>

-- 
Johan Bockgård


reply via email to

[Prev in Thread] Current Thread [Next in Thread]