all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <87ocuv3d80.fsf@arcor.de> (raw)
In-Reply-To: 23093020.post@talk.nabble.com

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	other threads:[~2009-04-17  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17  8:06 replacing two consecutive words where the two words could be separated by multiple spaces or newlines Nobuko Three
2009-04-17  8:18 ` David Engster [this message]
     [not found] ` <mailman.5514.1239956322.31690.help-gnu-emacs@gnu.org>
2009-04-19  4:43   ` jpkotta
2009-04-21  1:01     ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ocuv3d80.fsf@arcor.de \
    --to=deng@randomsample.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.