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

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

Re: replacing two consecutive words where the two words could be separat


From: David Engster
Subject: Re: replacing two consecutive words where the two words could be separated by multiple spaces or newlines.
Date: Fri, 17 Apr 2009 10:18:23 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

Nobuko Three <nbko3@yahoo.com> writes:
> I wanted to replace all occurrences of `a integer' with `an integer' in a
> latex file. But a simple query replace would replace the first `a integer'
> of the following paragraph, but not the second one because the second one is
> actually separated by a newline and two spaces (the indent).
>
>
>   This is a integer. That is a
>   integer. ...
>
> What is an automated way to change paragraphs like above to paragraphs like
> below?
>
>   This is an integer. That is an
>   integer. ...

You can do this using regular expressions:

M-x replace-regexp RET a\(\s-+\)integer RET an\1integer RET

-David





reply via email to

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