From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Make regexp handling more regular Date: Thu, 03 Dec 2020 12:40:28 -0500 Message-ID: References: <87lfeg60iy.fsf@gnus.org> <87blfbz3lu.fsf@gnus.org> <87mtyuomgz.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21454"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 03 18:47:51 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkshr-0005Sy-6r for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Dec 2020 18:47:51 +0100 Original-Received: from localhost ([::1]:40436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkshq-0006cZ-5U for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Dec 2020 12:47:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kksar-0001bu-5G for emacs-devel@gnu.org; Thu, 03 Dec 2020 12:40:37 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kksao-0000p8-LW for emacs-devel@gnu.org; Thu, 03 Dec 2020 12:40:36 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7DA78811FE; Thu, 3 Dec 2020 12:40:33 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2FB4D80B6D; Thu, 3 Dec 2020 12:40:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1607017231; bh=RgESOUvnR14xPeJ7L0tHRYwwh+LP8l4TG+mxmsRoeBE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=IzDtTQzl3ppGm8jaPyJcOfrzZKiut9H1xd9ZHVTUjck6bFhFzY/CmRjbj4BmkF3nU tuSy5GRe29I4rZAYlkUNlWI2kcVL8Zt1I4xO62gYX78PS2haXGa7kCrGQms3So1TZf EBNhMVRilIybokUC77Ph3C3ym4Ba2fk7lQu10f1iQRqy7SGL8NFjW4o1SZkxTqy/0Q ppC3blTIMw+I+B5QgqTXPEtplpjBUgCbQR7bXO5JF52JkbUZ6UM/J386+6dtO3GA5t e31iAg1I56GKGnZrrzp/E5HVRhWPsBvHnWQVUEQUGalV8nuIVTA4ND+pCI8b9LiZtN c7DQ33G3toK2A== Original-Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DD4E21204A2; Thu, 3 Dec 2020 12:40:30 -0500 (EST) In-Reply-To: <87mtyuomgz.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 03 Dec 2020 17:58:36 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:260233 Archived-At: >> (let-re-match (overall (beg end)) (re-match "regexp") >> ...) > Then we don't really need the re-match function at all... Yes and no: we do need some place to put the information about the OBJECT where we search, whether the search is anchored, where we START and where we END. > But I think this would be too somewhat cumbersome. Like, if you want to > write > > (while (setq m1 (re-search "foo")) > (setq m2 (re-match "[0-9]")) > (zot (re-string m1 0) (re-end m2 0))) Yes, that's related to the problem with dealing with match-failure. Stefan