[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cross Line Search
From: |
Joel J. Adamson |
Subject: |
Re: Cross Line Search |
Date: |
Wed, 05 Dec 2007 15:48:51 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Alberto Simões <albie@alfarrabio.di.uminho.pt> 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