[Top][All Lists]

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

Re: Replace whole words?

From: Jesper Harder
Subject: Re: Replace whole words?
Date: Sun, 31 Aug 2003 03:50:59 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

dum dee dee dum <address@hidden> writes:

> I have written a fairly long program, but I now want to find and
> replace all the 'int' s in the program to double as easily as
> possible. But I don't want the other words, variable names, etc. in
> the program that have 'int' in them (internationalization, for
> example) to change. Any ideas? M-% is an option, but I have to say
> yes or no for each word it finds to make sure that parts of words
> don't get replaced - I want to do this in just one command if
> possible.

You can replace by using a regular expression -- use `C-M-%'. 

"\<" matches the beginning of a word, and "\>" matches the end of a
word.  So "\<int\>" is the string you want to search for.

reply via email to

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