From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
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: Mon, 20 Apr 2009 19:01:02 -0600 [thread overview]
Message-ID: <gsj5s2$8pq$1@ger.gmane.org> (raw)
In-Reply-To: <00af68b0-6ded-4dcc-b0b6-46b027c505e7@c12g2000yqc.googlegroups.com>
jpkotta wrote:
> On Apr 17, 3:18 am, David Engster <d...@randomsample.de> wrote:
>> You can do this using regular expressions:
>>
>> M-x replace-regexp RET a\(\s-+\)integer RET an\1integer RET
>
> I was curious about the "\s-" because I've never seen such a thing.
> It sort of makes sense after RTFM, but it doesn't work all the time.
> Is it equivalent to "[[:space:]]"? Apparently, it depends on the
> major mode.
Of course :-)
> "a\([[:space:]^J]+\)integer" works for me, where "^J" is C-q C-j.
I think that newline has comment-ender syntax (not whitespace-character)
in some major modes.
--
Kevin Rodgers
Denver, Colorado, USA
prev parent reply other threads:[~2009-04-21 1:01 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
[not found] ` <mailman.5514.1239956322.31690.help-gnu-emacs@gnu.org>
2009-04-19 4:43 ` jpkotta
2009-04-21 1:01 ` Kevin Rodgers [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='gsj5s2$8pq$1@ger.gmane.org' \
--to=kevin.d.rodgers@gmail.com \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).