From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#31584: 27.0.50; Document again what match re-search-backward finds Date: Fri, 25 May 2018 00:47:49 +0200 Message-ID: <87po1kekmi.fsf@web.de> References: <87in7cg2qw.fsf@web.de> <87wovsg27f.fsf@ericabrahamsen.net> <87wovsg0q3.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527202029 26744 195.159.176.226 (24 May 2018 22:47:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 24 May 2018 22:47:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eric Abrahamsen , 31584@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 25 00:47:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLz0i-0006rs-K0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 May 2018 00:47:04 +0200 Original-Received: from localhost ([::1]:40968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLz2p-0008Uf-Qq for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 May 2018 18:49:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLz2f-0008TS-8a for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 18:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLz2c-0001hQ-5F for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 18:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLz2c-0001hL-1a for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 18:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fLz2b-00083a-Jr for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 18:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 May 2018 22:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31584 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31584-submit@debbugs.gnu.org id=B31584.152720209130915 (code B ref 31584); Thu, 24 May 2018 22:49:01 +0000 Original-Received: (at 31584) by debbugs.gnu.org; 24 May 2018 22:48:11 +0000 Original-Received: from localhost ([127.0.0.1]:47039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLz1n-00082Y-3e for submit@debbugs.gnu.org; Thu, 24 May 2018 18:48:11 -0400 Original-Received: from mout.web.de ([217.72.192.78]:39407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLz1j-00082J-DS for 31584@debbugs.gnu.org; Thu, 24 May 2018 18:48:07 -0400 Original-Received: from drachen.dragon ([188.110.196.170]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MV4TZ-1frbKt2T4X-00YOpj; Fri, 25 May 2018 00:47:50 +0200 In-Reply-To: <87wovsg0q3.fsf@gmail.com> (Noam Postavsky's message of "Thu, 24 May 2018 18:14:44 -0400") X-Provags-ID: V03:K1:f49DMdTECv7exZ5VUGr0bF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it@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146508 Archived-At: Noam Postavsky writes: > The docstring should definitely be clarified, but technically it can > still be answered, if you read very carefully: > > (re-search-backward REGEXP &optional BOUND NOERROR COUNT) > > Search backward from point for regular expression REGEXP. > This function is almost identical to =E2=80=98re-search-forward=E2=80= =99, except that > by default it searches backward instead of forward, and the sign of > COUNT also indicates exactly the opposite searching direction. > > (re-search-forward REGEXP &optional BOUND NOERROR COUNT) > > [...] > With COUNT positive/negative, the match found is [...] located > entirely after/before the origin of the search. You mean the sentence about the COUNT arg? Yes, _very_ carefully. > It is greedy: > > (with-temp-buffer > (insert "xxxxyyyy") > (and (re-search-backward "x+y*" nil t) > (match-string 0))) ;=3D> "xyyyy" > > Non-greedy wouldn't match any "y"s. It's a bit tricky to explain both > correctly and clearly... Ok, good example. You convinced me that the sentence we once had was actually quite good. Michael.