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: Kevin Rodgers
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
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

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





reply via email to

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