[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9681: Broken behaviour of re-search-backward (.+ matching only a sin
From: |
Stefan Monnier |
Subject: |
bug#9681: Broken behaviour of re-search-backward (.+ matching only a single character) |
Date: |
Fri, 07 Oct 2011 09:02:18 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) |
>> re-search-* stops at the first character position that has a match.
>> And then it chooses the longest match at that position.
> Thanks, but I'm not sure I understand what you mean here. Naturally, the
> longest match for `re-search-backward' should be backward, not forward,
Ah, yes, sorry for being unclear: the search for a match goes backward,
but the matching itself goes forward.
The docstring of re-search-backward is more clear about that:
The match found is the one starting last in the buffer
and yet ending before the origin of the search.
> If I'm the only one who considers this behaviour broken (by design?[1]),
It's not the ideal behavior, admittedly. It's even more obvious in
`looking-back'. But fixing it would require the implementation of
a backward regexp matcher.
Stefan
bug#9681: Broken behaviour of re-search-backward (.+ matching only a single character), Johan Bockgård, 2011/10/06