emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Matches for multiline regexps


From: Luc Teirlinck
Subject: Matches for multiline regexps
Date: Wed, 15 Jun 2005 20:40:15 -0500 (CDT)

There are some inconsistencies between `occur' and friends on the one
hand and `how-many', `flush-lines' and `keep-lines' on the other hand,
in as far as matches for multiline regexps are concerned.

In a buffer containing five lines all containing "11":

11
11
11
11
11

`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.

The difference is that how-many, after finding the match on line one,
skips over the match, and starts searching for the next match at the
end of that match, hence not finding the match at the beginning of
line 2 (which is partially covered by the first match).

`flush-lines' and `keep-lines' follow the `how-many' "philosophy".

Should I just document the difference, or is this a bug in `how-many'
and friends that needs to be fixed?

Sincerely,

Luc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]