all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* replacing phrases: matching line feeds in regular expressions, since \s- doesn't work
@ 2012-02-18 17:52 Steve Petersen
  2012-02-18 19:17 ` Thorsten
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Steve Petersen @ 2012-02-18 17:52 UTC (permalink / raw)
  To: Help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 734 bytes --]

Hi emacs gurus,

[I accidentally posted this first to the main emacs forum, pardon my
newbness.]

I've spent hours scouring the web trying to solve what should be a simple
problem.  I appreciate any help!

I want to replace a three-word phrase with an acronym.  Should be easy,
right?  But of course I want to match across lines.  From what I read '\s-'
should match line feeds, but it doesn't.  The closest I've gotten to
matching across lines is using 'foo[\s-^J]+bar' (using ^Q to insert ^J
literally), but for some reason that *doesn't* match 'foo bar' on the same
line!  I'm out of ideas - what's going on?

I'm using GNU Emacs 23.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.35).

Thanks,
Steve

-- 

http://stevepetersen.net

[-- Attachment #2: Type: text/html, Size: 927 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: replacing phrases: matching line feeds in regular expressions, since \s- doesn't work
@ 2012-02-18 21:26 Silvio Levy
  2012-02-19  3:04 ` jeremiah.dodds
  0 siblings, 1 reply; 9+ messages in thread
From: Silvio Levy @ 2012-02-18 21:26 UTC (permalink / raw)
  To: Thorsten; +Cc: help-gnu-emacs


It seems to work for me with 'foo[\s^J]+bar' (no hyphen in the
character class -- the hyphen is for a range, like [a-z])

Silvio





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-02-19  3:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-18 17:52 replacing phrases: matching line feeds in regular expressions, since \s- doesn't work Steve Petersen
2012-02-18 19:17 ` Thorsten
2012-02-18 19:33 ` jeremiah.dodds
2012-02-18 20:44   ` Peter Dyballa
2012-02-19  2:47     ` jeremiah.dodds
2012-02-18 23:30   ` bitterspetey
2012-02-19  0:15 ` Eric Abrahamsen
  -- strict thread matches above, loose matches on Subject: below --
2012-02-18 21:26 Silvio Levy
2012-02-19  3:04 ` jeremiah.dodds

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.