GNU bug report logs - #31584
27.0.50; Document again what match re-search-backward finds

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Thu, 24 May 2018 21:32:02 UTC

Severity: minor

Tags: fixed

Found in version 27.0.50

Fixed in version 26.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Noam Postavsky <npostavs <at> gmail.com>, Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 31584 <at> debbugs.gnu.org
Subject: bug#31584: 27.0.50; Document again what match re-search-backward finds
Date: Thu, 24 May 2018 17:28:54 -0700 (PDT)
> It is greedy:
> (with-temp-buffer
>   (insert "xxxxyyyy")
>   (and (re-search-backward "x+y*" nil t) (match-string 0))) ;=> "xyyyy"
> 
> Non-greedy wouldn't match any "y"s.  It's a bit tricky to explain both
> correctly and clearly...

Maybe it would help to say that the pattern is always matched in a forward direction, even when it matches text that is before point.

The pattern itself is not read backward (you don't write +x*y
for the reverse search of x+y*), and it doesn't match backward.




This bug report was last modified 6 years and 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.