[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestion: check for \n, \t in regexp for query-replace-regexp
From: |
William F. Hammond |
Subject: |
Re: Suggestion: check for \n, \t in regexp for query-replace-regexp |
Date: |
02 Dec 2001 12:05:10 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
David.Kastrup@t-online.de (David Kastrup) writes:
> >>>>> "Richard" == Richard Stallman <rms@gnu.org> writes:
>
> Richard> I made it warn about such input but not reject it.
> Richard> After all, you might want to replace a backslash and an n.
>
> In which case you were supposed to say \\n, not \n.
In historic regexps "\n" matches "n", not a newline. That must be
related to why isearch-forward-regexp is the way it is.
Since the C-q C-j thing works with isearch-forward-regexp regardless
of underlying system newline conventions, I see no objection to it.
But _if_ I find such use of C-j abrasive, then, while interactive, I
may use, for example,
M-q (re-search-forward "\nDate: " nil t)
while remembering for this context that '\' needs to be doubled to
produce a single '\' in the search-string argument.
-- Bill