From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jadamson@partners.org (Joel J. Adamson) Newsgroups: gmane.emacs.help Subject: Re: Cross Line Search Date: Wed, 05 Dec 2007 15:48:51 -0500 Organization: I need to put my ORGANIZATION here. Message-ID: <87tzmw27gs.fsf@W0053328.mgh.harvard.edu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1196890857 8931 80.91.229.12 (5 Dec 2007 21:40:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2007 21:40:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 05 22:40:58 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J01z1-0008NU-Tm for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Dec 2007 22:40:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J01yk-0003mB-59 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Dec 2007 16:40:26 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!proxad.net!feeder1-2.proxad.net!62.111.101.3.MISMATCH!news.germany.com!news.belwue.de!LF.net!quimby.gnus.org!news.ccs.neu.edu!news.dfci.harvard.edu!news.harvard.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: w0053328.mgh.harvard.edu Original-X-Trace: plato.harvard.edu 1196887731 32211 132.183.29.121 (5 Dec 2007 20:48:51 GMT) Original-X-Complaints-To: news@plato.harvard.edu Original-NNTP-Posting-Date: Wed, 5 Dec 2007 20:48:51 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:VE4RUqfRjd06ql/rA9JCybbXqJY= Original-Xref: shelby.stanford.edu gnu.emacs.help:154441 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49870 Archived-At: Alberto Simões writes: [...] > Some times (fortunately not all the times) those words are on > different lines (thus, with a new line in the middle) and the usual > search method does not find it. [...] > The question is: is there any search function to help me on this? I > know it is probably easy to write it, but as my lisp coding skills are > near the bottom line, probably it is a good idea to ask first :) What you need is a regular expression with a quoted newline (quoted in the sense of a keystroke, not in the Lisp sense). Something like \([ ]\)\(regular\)\1\(expression\)\1 will match "regular expression" or "regular expression" in Regexp I-search (M-C-s, M-C-Sh-% for query-replace-regexp). In the square brackets, I inserted a newline with the key sequence "C-q C-j" The "C-q" quotes the "C-j" so that it's interpreted as a newline. HTH Joel -- Joel J. Adamson Biostatistician Pediatric Psychopharmacology Research Unit Massachusetts General Hospital Boston, MA 02114 (617) 643-1432 (303) 880-3109