Re: Matches for multiline regexps

From:

Luc Teirlinck

Subject:

Re: Matches for multiline regexps

Date:

Thu, 16 Jun 2005 22:30:33 -0500 (CDT)

Richard Stallman wrote:
`M-x occur RET 11 C-q C-j 11 RET' finds four matches (lines 1 through 4)
which seems logical to me.
`M-x how-many RET 11 C-q C-j 11 RET' (with point at bob) finds two
matches.
One function looks for lines that match, while the other finds
matches, so it is natural that they may differ.
But `keep-lines' and `flush-lines' also look for lines that match.
Just to be sure: is the following behavior intended:
Start with a buffer containing three lines with "11" in them and a
final newline:
11
11
11
Result of `M-x keep-lines RET 11 C-q C-j 11 RET' with point at bob:
11
11
(The `occur' interpretation would keep all three lines.)
Result of `M-x flush-lines RET 11 C-q C-j 11 RET' with point at bob:
11
(The `occur' interpretation would delete all three lines.)
Maybe it is OK (just asking to be sure).
Sincerely,
Luc.