From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Petersen Newsgroups: gmane.emacs.help Subject: replacing phrases: matching line feeds in regular expressions, since \s- doesn't work Date: Sat, 18 Feb 2012 12:52:15 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=002354471a40fccdad04b940b923 X-Trace: dough.gmane.org 1329591630 17535 80.91.229.3 (18 Feb 2012 19:00:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2012 19:00:30 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 18 20:00:29 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RypWD-0004Ir-En for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2012 20:00:25 +0100 Original-Received: from localhost ([::1]:55523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RypWC-0001KF-GP for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2012 14:00:24 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:38766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyoSc-0007hd-R3 for Help-gnu-emacs@gnu.org; Sat, 18 Feb 2012 12:52:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyoSb-0005zk-F7 for Help-gnu-emacs@gnu.org; Sat, 18 Feb 2012 12:52:38 -0500 Original-Received: from mail-qw0-f48.google.com ([209.85.216.48]:44295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyoSb-0005zc-6g for Help-gnu-emacs@gnu.org; Sat, 18 Feb 2012 12:52:37 -0500 Original-Received: by qauh8 with SMTP id h8so5281413qau.0 for ; Sat, 18 Feb 2012 09:52:36 -0800 (PST) Received-SPF: pass (google.com: domain of spetey@gmail.com designates 10.229.77.17 as permitted sender) client-ip=10.229.77.17; Authentication-Results: mr.google.com; spf=pass (google.com: domain of spetey@gmail.com designates 10.229.77.17 as permitted sender) smtp.mail=spetey@gmail.com; dkim=pass header.i=spetey@gmail.com Original-Received: from mr.google.com ([10.229.77.17]) by 10.229.77.17 with SMTP id e17mr9927184qck.10.1329587556317 (num_hops = 1); Sat, 18 Feb 2012 09:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=3gtIPZBHBPxc7d2sVmHW+wcpNvCnMSUBryDFNzV8o+o=; b=w9wsQBFiIwFieHgk6DeTaeusmoZVvWQjfWXHPtoiETg4iIfjlgTNoLDERUPkx8w7eJ fSmaQxk/MllrNeCFNdR32myA7b0th2QVhQOMkIHg/lTd5OIi7ImuBgN5men1Az1TL7qk HNjOPUx3jkKGrwBW+Cxw/XuzwYxhf9pzXQ9E0= Original-Received: by 10.229.77.17 with SMTP id e17mr8464656qck.10.1329587556240; Sat, 18 Feb 2012 09:52:36 -0800 (PST) Original-Received: by 10.229.76.142 with HTTP; Sat, 18 Feb 2012 09:52:15 -0800 (PST) X-Google-Sender-Auth: 9e7OsrJCBZ7KOjV0biRvN2GblSU X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.216.48 X-Mailman-Approved-At: Sat, 18 Feb 2012 14:00:17 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83788 Archived-At: --002354471a40fccdad04b940b923 Content-Type: text/plain; charset=ISO-8859-1 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 --002354471a40fccdad04b940b923 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi emacs gurus,

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

I've spent hours scouring the web trying to solve w= hat should be a simple problem. =A0I appreciate any help!=A0

I want to replace a three-word phrase with an acronym. =A0Should=20 be easy, right? =A0But of course I want to match across lines. =A0From what= I read '\s-' should match line feeds, but it doesn't. =A0The clo= sest I've=20 gotten to matching across lines is using 'foo[\s-^J]+bar' (using ^Q= to=20 insert ^J literally), but for some reason that doesn't=A0match &= #39;foo bar' on the same line! =A0I'm out of ideas - what's goi= ng on?

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

Thanks,
Steve

--

http://stevepetersen.net
--002354471a40fccdad04b940b923--