From unknown Tue Jun 17 01:26:09 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#5393 <5393@debbugs.gnu.org> To: bug#5393 <5393@debbugs.gnu.org> Subject: Status: Patch for lookaround assertion in regexp Reply-To: bug#5393 <5393@debbugs.gnu.org> Date: Tue, 17 Jun 2025 08:26:09 +0000 retitle 5393 Patch for lookaround assertion in regexp reassign 5393 emacs submitter 5393 Tomohiro MATSUYAMA severity 5393 wishlist tag 5393 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 15 13:45:36 2010 Received: (at quiet) by debbugs.gnu.org; 15 Jan 2010 18:45:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NVrAt-0007D7-JY for submit@debbugs.gnu.org; Fri, 15 Jan 2010 13:45:35 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NVrAk-0007Cq-0k for quiet@debbugs.gnu.org; Fri, 15 Jan 2010 13:45:26 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NVrAf-0007ha-Lm for quiet@debbugs.gnu.org; Fri, 15 Jan 2010 13:45:21 -0500 From: Tomohiro MATSUYAMA To: quiet@debbugs.gnu.org Subject: Patch for lookaround assertion in regexp Date: Thu, 4 Jun 2009 08:04:25 +0900 Lines: 509 X-From-Line: emacs-devel-bounces+rgm=gnu.org@gnu.org Wed Jun 3 22:52:10 2009 Received: from mx10.gnu.org ([199.232.76.166]:50249) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MC32z-0002av-5e for rgm@gnu.org; Wed, 03 Jun 2009 22:52:10 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MC32v-00068s-6S for rgm@gnu.org; Wed, 03 Jun 2009 22:51:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DNS_FROM_RFC_POST, UNPARSEABLE_RELAY autolearn=no version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:37880) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MC32u-00068k-Qu for rgm@gnu.org; Wed, 03 Jun 2009 22:51:12 -0400 Received: from localhost ([127.0.0.1]:41265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MC32u-0005GY-OS for rgm@gnu.org; Wed, 03 Jun 2009 22:51:12 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MBzVZ-00044a-Dt for emacs-devel@gnu.org; Wed, 03 Jun 2009 19:04:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MBzVU-000433-3D for emacs-devel@gnu.org; Wed, 03 Jun 2009 19:04:32 -0400 Received: from [199.232.76.173] (port=47210 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBzVT-000430-VL for emacs-devel@gnu.org; Wed, 03 Jun 2009 19:04:28 -0400 Received: from mail-qy0-f184.google.com ([209.85.221.184]:52994) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MBzVT-0007ft-4Z for emacs-devel@gnu.org; Wed, 03 Jun 2009 19:04:27 -0400 Received: by qyk14 with SMTP id 14so626713qyk.14 for ; Wed, 03 Jun 2009 16:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ycCIYX/dE/3KAd++YBMdxE3BnOi/V1F7JWLkT+j3Z4o=; b=PijZx4W2rQ7RhNmj1ptkHEftrtdvsJcqUaKjQqNFV02UGSHkmjPywKUzh4gSfx6kiT zQUXwKt/ilIW3dqkYnbkvli5HkOmYmdf5sjZvjeDr6TVCLqjW4Eqe7WSFkI55/sLmDyf 9JphCA66hJa8WFEjc8FuaV2DUfL/5uAF4gHVg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=b5FKtc1ZIgUw29wF5joH59mHaUIO9r/ULcaDjgXxaqBitJbPhKad7cK+q66vRBWBcY wCrii7cSafc9/wQwsxyGQcR0EkfMXL2tcLvCZOQa0aiuT2Rf11jprAbeOyMr0fi0dLYH NlIoe6mEZI/r2D/xioCQSdIer41N5gtHuTIjk= Received: by 10.220.46.20 with SMTP id h20mr1269423vcf.55.1244070265807; Wed, 03 Jun 2009 16:04:25 -0700 (PDT) X-Debbugs-No-Ack: yes X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Wed, 03 Jun 2009 22:50:33 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: quiet X-Mailman-Approved-At: Fri, 15 Jan 2010 13:45:34 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Severity: wishlist Tags: patch [ resent from http://lists.gnu.org/archive/html/emacs-devel/2009-06/msg00094.html ] Hi, all I have attached a patch that enables you to use lookaround assertion in regexp with following syntax: * Positive lookahead assertion \(?=...\) * Negative lookahead assertion \(?!...\) * Positive lookbehind assertion \(?<=...\) * Negative lookbehind assertion \(?) id 1RpP6u-0005UW-6W for submit@debbugs.gnu.org; Mon, 23 Jan 2012 13:59:20 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:51577 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RpP6r-0005UO-F1 for control@debbugs.gnu.org; Mon, 23 Jan 2012 13:59:18 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RpP6b-00077v-6Q for control@debbugs.gnu.org; Mon, 23 Jan 2012 13:59:01 -0500 Date: Mon, 23 Jan 2012 13:59:01 -0500 Message-Id: Subject: control message for bug 5393 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) forwarded 5393 http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00732.html From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 01:23:51 2016 Received: (at 5393) by debbugs.gnu.org; 28 Feb 2016 06:23:51 +0000 Received: from localhost ([127.0.0.1]:49422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZulj-0003jD-90 for submit@debbugs.gnu.org; Sun, 28 Feb 2016 01:23:51 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:53449) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZulh-0003j5-Ed for 5393@debbugs.gnu.org; Sun, 28 Feb 2016 01:23:49 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZulI-0004Oj-MD; Sun, 28 Feb 2016 07:23:25 +0100 From: Lars Ingebrigtsen To: Glenn Morris Subject: Re: control message for bug 5393 References: Date: Sun, 28 Feb 2016 17:23:19 +1100 In-Reply-To: (Glenn Morris's message of "Mon, 23 Jan 2012 13:59:01 -0500") Message-ID: <87twkts694.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aZulI-0004Oj-MD X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457245405.5496@ZWPyZ+eymvYXptiO/gJBBg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 5393 Cc: 5393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Glenn Morris writes: > forwarded 5393 http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00732.html I was unable to find the patch in question on that link... Anybody? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 05:26:05 2016 Received: (at 5393) by debbugs.gnu.org; 28 Feb 2016 10:26:05 +0000 Received: from localhost ([127.0.0.1]:49535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZyY6-0004il-7z for submit@debbugs.gnu.org; Sun, 28 Feb 2016 05:26:05 -0500 Received: from mout.gmx.net ([212.227.15.19]:63719) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZyY0-0004i7-F6 for 5393@debbugs.gnu.org; Sun, 28 Feb 2016 05:26:00 -0500 Received: from rosalinde ([89.245.96.185]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MYfre-1aMCui1WOg-00VTwd; Sun, 28 Feb 2016 11:25:50 +0100 From: Stephen Berman To: Lars Ingebrigtsen Subject: Re: bug#5393: control message for bug 5393 References: <87twkts694.fsf@gnus.org> Date: Sun, 28 Feb 2016 11:25:49 +0100 In-Reply-To: <87twkts694.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 28 Feb 2016 17:23:19 +1100") Message-ID: <87h9gtdtci.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:bNOrsDbXGCVeoInvOQvjW5QGHzlJKH9ijVZu8HKlwP9KHAc7yBa lAv0a4XTmzCmjM4SUAPIhm3zRBhAys5AyYjaVdjkEnJYuhRey3WXp0T9j25PVax3v0f+3lj fd2nu8HhK0k6gvPS3B67zcVJbGlJsH+O0GXfbI6UC/XIiliURTer6ot7OFRJ5DHZv4Sipn9 M70UOvbHhAUWsTXEa1++A== X-UI-Out-Filterresults: notjunk:1;V01:K0:X/iMI1Qyvu8=:RlVye19v2YRnzuJd6qyXiD 3kgJ3HzLPGmAglmLxHMgzvZeUcpXRqR7lj66qKjmaPyVQNIOGeSnN0J4oiKC6ZJ1j2fXYG3bn YoH3CSpEVdKZCkndj/B0xXPz2uh58ad8rF8bZ9zaeSsJZwAyZLLQ6Nytbfy5ZAfQzMPrvswiC 4GmAJFFgQK1iU3YAKlPeVn/Y9L8rTx5NsrWZUTL+V7qxn6DS3gdfXNihilxhrmK1yptB1TdQ7 qqISVjHItargvrfszP5o9peuoKC/l2VDQB+f/zXd6w7syNFq4zKrnlF9Z0Alw+/FOEJz2nhhq QmVRZeqmZfk4kP52FRoQCs/tkBSdqxzWurKUVHIiycaPo0fD6jf2JGOBdEKyrp3NaU4W450/X oy/3Ajb9CD4YVqG1nsUWlWune31fd2L/6sLtR27cYk+DxCORtDXqCXa1WBAf/cr70MO7DXjY+ Ak1isjxdIHZO8k63blx9v6FuBQ1JoRGO1qyaJRjtZc49fuGVpmSbOyNjNJvuVwp+9/rhQEafM ketjYLmnapYsub344IQwqUIE51VECf9ikVn28DM3lXR8ebN1Uv+Z1Feh7vIobmkWxjRp/dUaR QPXc/JDJ8+1CIO830RO+YPFhRDEKXeCbFbj2z9PcF8lCDb280YLEoCnxLm7rxqQKvCP91IKkK Qb2abe54rh8MXaQCQgAvi6f4BD0gXu627SIZmr6ubYklc0FhzDqx24rD0QdmsXLYG6vrl6JXi AWZkQRYnpC9uvJKQqlDG7T9NYUkb6RUiw/RSxELSHQHHBjl9cZWWPyzrk8FFTu1eCp/+vEVWD 8G+skpQ X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 5393 Cc: Glenn Morris , 5393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sun, 28 Feb 2016 17:23:19 +1100 Lars Ingebrigtsen wrote: > Glenn Morris writes: > >> forwarded 5393 http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00732.html > > I was unable to find the patch in question on that link... Anybody? I think it's here: http://lists.gnu.org/archive/html/emacs-devel/2009-06/msg00094.html Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 13:23:06 2016 Received: (at 5393) by debbugs.gnu.org; 28 Feb 2016 18:23:06 +0000 Received: from localhost ([127.0.0.1]:50997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aa5zm-0008BI-Kc for submit@debbugs.gnu.org; Sun, 28 Feb 2016 13:23:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36869) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aa5zk-0008Ad-Ve for 5393@debbugs.gnu.org; Sun, 28 Feb 2016 13:23:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aa5zf-00023x-3j for 5393@debbugs.gnu.org; Sun, 28 Feb 2016 13:22:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aa5zX-0001xh-0X; Sun, 28 Feb 2016 13:22:51 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1aa5zS-0006Dh-RD; Sun, 28 Feb 2016 13:22:46 -0500 From: Glenn Morris To: Lars Ingebrigtsen Subject: Re: control message for bug 5393 References: <87twkts694.fsf@gnus.org> X-Spook: [Hello to all my friends and fans in domestic X-Ran: ^Hxt39]r`B%aOO55?y]9w&: X-Hue: yellow X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sun, 28 Feb 2016 13:22:46 -0500 In-Reply-To: <87twkts694.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 28 Feb 2016 17:23:19 +1100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 5393 Cc: 5393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Lars Ingebrigtsen wrote: > Glenn Morris writes: > >> forwarded 5393 >> http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00732.html > > I was unable to find the patch in question on that link... Anybody? I just use "forwarded" to link to a place with more recent discussion. The patch is in the original bug report, the only message in the report. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 21:30:41 2016 Received: (at 5393) by debbugs.gnu.org; 29 Feb 2016 02:30:42 +0000 Received: from localhost ([127.0.0.1]:51144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaDbc-0006zA-O3 for submit@debbugs.gnu.org; Sun, 28 Feb 2016 21:30:41 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:35343) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaDba-0006w5-9M for 5393@debbugs.gnu.org; Sun, 28 Feb 2016 21:30:39 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aaDb9-0007zc-W0; Mon, 29 Feb 2016 03:30:13 +0100 From: Lars Ingebrigtsen To: Stephen Berman Subject: Re: bug#5393: control message for bug 5393 References: <87twkts694.fsf@gnus.org> <87h9gtdtci.fsf@gmx.net> Date: Mon, 29 Feb 2016 13:30:07 +1100 In-Reply-To: <87h9gtdtci.fsf@gmx.net> (Stephen Berman's message of "Sun, 28 Feb 2016 11:25:49 +0100") Message-ID: <874mcs45ao.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable X-MailScanner-ID: 1aaDb9-0007zc-W0 X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457317813.49214@/En6AOLUpmaNdPAh3MhUog X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 5393 Cc: Glenn Morris , 5393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Stephen Berman writes: > I think it's here: > > http://lists.gnu.org/archive/html/emacs-devel/2009-06/msg00094.html I have included the patch below for easier reading. Lookahead and lookbehind are useful, I guess, but the regex code in Emacs is a mystery to me, so I can't really judge the patch. Index: src/regex.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/regex.c,v retrieving revision 1.236 diff -u -r1.236 regex.c --- src/regex.c 8 Jan 2009 03:15:54 -0000 1.236 +++ src/regex.c 3 Jun 2009 22:35:17 -0000 @@ -735,7 +735,14 @@ syntaxspec, =20 /* Matches any character whose syntax is not that specified. */ - notsyntaxspec + notsyntaxspec, + + lookahead, + lookahead_not, + lookbehind, + lookbehind_not, + lookaround_succeed, + lookaround_fail =20 #ifdef emacs ,before_dot, /* Succeeds if before point. */ @@ -1033,6 +1040,36 @@ fprintf (stderr, "/stop_memory/%d", *p++); break; =20 + case lookahead: + extract_number_and_incr (&mcnt, &p); + fprintf (stderr, "/lookahead/%d", mcnt); + break; + + case lookahead_not: + extract_number_and_incr (&mcnt, &p); + fprintf (stderr, "/lookahead_not/%d", mcnt); + break; + + case lookbehind: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + fprintf (stderr, "/lookbehind/%d/%d", mcnt, mcnt2); + break; + + case lookbehind_not: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + fprintf (stderr, "/lookbehind_not/%d/%d", mcnt, mcnt2); + break; + + case lookaround_succeed: + fprintf (stderr, "/lookaround_succeed"); + break; + + case lookaround_fail: + fprintf (stderr, "/lookaround_fail"); + break; +=20=20=20=20=20=20=20=20=20=20=20=20 case duplicate: fprintf (stderr, "/duplicate/%d", *p++); break; @@ -1600,11 +1637,17 @@ } \ else \ { \ - regend[reg] =3D POP_FAILURE_POINTER (); \ - regstart[reg] =3D POP_FAILURE_POINTER (); \ - DEBUG_PRINT4 (" Pop reg %d (spanning %p -> %p)\n", \ - reg, regstart[reg], regend[reg]); \ - } \ + re_char *start, *end; \ + end =3D POP_FAILURE_POINTER (); \ + start =3D POP_FAILURE_POINTER (); \ + if (!discard_saved_regs) \ + { \ + regstart[reg] =3D start; \ + regend[reg] =3D end; \ + DEBUG_PRINT4 (" Pop reg %d (spanning %p -> %p)\n", \ + reg, regstart[reg], regend[reg]); \ + } \ + } \ } while (0) =20 /* Check that we are not stuck in an infinite loop. */ @@ -1702,7 +1745,7 @@ while (fail_stack.frame < fail_stack.avail) \ POP_FAILURE_REG_OR_COUNT (); \ \ - pat =3D POP_FAILURE_POINTER (); \ + pat =3D POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" Popping pattern %p: ", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ @@ -1724,6 +1767,29 @@ } while (0) /* POP_FAILURE_POINT */ =20 =20 +#define FINISH_LOOKAROUND() \ + do { \ + re_char *str, *pat; \ + re_opcode_t op; \ + discard_saved_regs =3D 1; \ + while (!FAIL_STACK_EMPTY ()) \ + { \ + POP_FAILURE_POINT (str, pat); \ + op =3D (re_opcode_t) *pat; \ + if (op =3D=3D lookahead \ + || op =3D=3D lookahead_not \ + || op =3D=3D lookbehind \ + || op =3D=3D lookbehind_not) \ + { \ + d =3D str; \ + dend =3D ((d >=3D string1 && d <=3D end1) \ + ? end_match_1 : end_match_2); \ + break; \ + } \ + } \ + discard_saved_regs =3D 0; \ + } while (0); + /* Registers are set to a sentinel when they haven't yet matched. */ #define REG_UNSET(e) ((e) =3D=3D NULL) @@ -1922,6 +1988,7 @@ pattern_offset_t fixup_alt_jump; pattern_offset_t laststart_offset; regnum_t regnum; + int lookaround; } compile_stack_elt_t; =20 =20 @@ -2522,6 +2589,8 @@ compile_stack, regnum_t regnum)); =20 +static int exact_chars_in_pattern_buffer _RE_ARGS ((struct re_pattern_buff= er *bufp, re_char *p, re_char *pend)); + /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. Returns one of error codes defined in `regex.h', or zero for success. =20 @@ -3261,6 +3330,7 @@ handle_open: { int shy =3D 0; + int lookaround =3D 0; regnum_t regnum =3D 0; if (p+1 < pend) { @@ -3282,6 +3352,27 @@ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': regnum =3D 10*regnum + (c - '0'); break; + case '=3D': + /* Positive lookahead assertion. */ + shy =3D lookaround =3D 1; + break; + case '!': + /* Negative lookahead assertion. */ + shy =3D lookaround =3D 2; + break; + case '<': + { + PATFETCH (c); + if (c =3D=3D '=3D') + /* Positive lookbehind assertion. */ + shy =3D lookaround =3D -1; + else if (c =3D=3D '!') + /* Negative lookbehind assertion. */ + shy =3D lookaround =3D -2; + else + FREE_STACK_RETURN (REG_BADPAT); + } + break; default: /* Only (?:...) is supported right now. */ FREE_STACK_RETURN (REG_BADPAT); @@ -3328,6 +3419,7 @@ =3D fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; COMPILE_STACK_TOP.laststart_offset =3D b - bufp->buffer; COMPILE_STACK_TOP.regnum =3D regnum; + COMPILE_STACK_TOP.lookaround =3D lookaround; =20 /* Do not push a start_memory for groups beyond the last one we can represent in the compiled pattern. */ @@ -3377,6 +3469,7 @@ later groups should continue to be numbered higher, as in `(ab)c(de)' -- the second group is #2. */ regnum_t regnum; + int lookaround; =20 compile_stack.avail--; begalt =3D bufp->buffer + COMPILE_STACK_TOP.begalt_offset; @@ -3389,13 +3482,40 @@ /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ + lookaround =3D COMPILE_STACK_TOP.lookaround; pending_exact =3D 0; =20 /* We're at the end of the group, so now we know how many groups were inside this one. */ if (regnum <=3D MAX_REGNUM && regnum > 0) BUF_PUSH_2 (stop_memory, regnum); - } + else if (lookaround) + { + if (lookaround > 0) + { + /* Positive/negative lookahead assertion. */ + GET_BUFFER_SPACE (3); + INSERT_JUMP (lookaround =3D=3D 1 ? lookahead : loo= kahead_not, laststart, b + 4); + b +=3D 3; + } + else + { + /* Positive/negative lookbehind assertion. */ + int count =3D exact_chars_in_pattern_buffer (bufp,= laststart, b); + if (count =3D=3D -1) /* variable length */ + FREE_STACK_RETURN (REG_BADPAT); + + GET_BUFFER_SPACE (5); + INSERT_JUMP2 (lookaround =3D=3D -1 ? lookbehind : = lookbehind_not, laststart, b + 6, count); + b +=3D 5; + } +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + /* Negative form. */ + if (lookaround > 1 || lookaround < -1) + BUF_PUSH (lookaround_fail); + BUF_PUSH (lookaround_succeed); + } + } break; =20 =20 @@ -3949,10 +4069,16 @@ /* After an alternative? */ || (*prev =3D=3D '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash= )) /* After a shy subexpression? */ - || ((syntax & RE_SHY_GROUPS) && prev - 2 >=3D pattern - && prev[-1] =3D=3D '?' && prev[-2] =3D=3D '(' - && (syntax & RE_NO_BK_PARENS - || (prev - 3 >=3D pattern && prev[-3] =3D=3D '\\'))); + || ((syntax & RE_SHY_GROUPS) + && ((prev - 2 >=3D pattern + && prev[-1] =3D=3D '?' && prev[-2] =3D=3D '(' + && (syntax & RE_NO_BK_PARENS + || (prev - 3 >=3D pattern && prev[-3] =3D=3D '\\'))) + || (prev - 3 >=3D pattern + && (*prev =3D=3D '=3D' || *prev =3D=3D '!') + && prev[-1] =3D=3D '<' && prev[-2] =3D=3D '?' && prev[-3] =3D= =3D '(' + && (syntax & RE_NO_BK_PARENS + || (prev - 4 >=3D pattern && prev[-4] =3D=3D '\\'))))); } =20 =20 @@ -4198,6 +4324,13 @@ } break; =20 + case lookahead: + case lookahead_not: + case lookbehind: + case lookbehind_not: + if (!fastmap) break; + return -1; +=20=20=20=20=20=20=20=20=20=20 /* All cases after this match the empty string. These end with `continue'. */ =20 @@ -4827,7 +4960,7 @@ { case start_memory: case stop_memory: - p +=3D 2; break; + p +=3D 2; break; case no_op: p +=3D 1; break; case jump: @@ -4843,6 +4976,93 @@ return p; } =20 +static int +exact_chars_in_pattern_buffer (bufp, p, pend) + struct re_pattern_buffer *bufp; + re_char *p, *pend; +{ + int count =3D 0; + while (p < pend) + { + switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) + { + case exactn: + { + int mcnt =3D *p++; + int buf_charlen; + while (mcnt > 0) { + STRING_CHAR_AND_LENGTH (p, p - pend, buf_charlen); + p +=3D buf_charlen; + mcnt -=3D buf_charlen; + count++; + } + } + break; + case start_memory: + case stop_memory: + p++; + break; +#ifdef emacs + case categoryspec: + case notcategoryspec: +#endif /* emacs */ + case syntaxspec: + case notsyntaxspec: + p++; + case anychar: + count++; + break; + + case charset: + case charset_not: + if (CHARSET_RANGE_TABLE_EXISTS_P (p - 1)) + { + int mcnt; + p =3D CHARSET_RANGE_TABLE (p - 1); + EXTRACT_NUMBER_AND_INCR (mcnt, p); + p =3D CHARSET_RANGE_TABLE_END (p, mcnt); + } + else + p +=3D 1 + CHARSET_BITMAP_SIZE (p - 1); + count++; + break; + +#ifdef emacs + case before_dot: + case at_dot: + case after_dot: +#endif /* emacs */ + case no_op: + case begline: + case endline: + case begbuf: + case endbuf: + case wordbound: + case notwordbound: + case wordbeg: + case wordend: + case symbeg: + case symend: + /* Zero width. */ + continue; + case lookahead: + case lookahead_not: + case lookbehind: + case lookbehind_not: + /* Skip to lookaround_success. */ + while (p < pend) + { + if ((re_opcode_t) *p++ =3D=3D lookaround_succeed) + break; + } + break; + default: + return -1; + } + } + return count; +} + /* Non-zero if "p1 matches something" implies "p2 fails". */ static int mutually_exclusive_p (bufp, p1, p2) @@ -5200,6 +5420,9 @@ re_char **best_regstart, **best_regend; #endif =20 + /* Discard a saved register from the stack. */ + boolean discard_saved_regs =3D 0; + /* Logically, this is `best_regend[0]'. But we don't want to have to allocate space for that if we're not allocating space for anything else (see below). Also, we never need info about register 0 for @@ -5772,6 +5995,77 @@ p +=3D 1; break; =20 + case lookahead: + case lookahead_not: + DEBUG_PRINT1 ((re_opcode_t) *(p - 1) =3D=3D lookahead ? "EXECUTI= NG lookahead.\n" : "EXECUTING lookahead_not.\n"); + + p +=3D 2; + PUSH_FAILURE_POINT (p - 3, d); + break; + + case lookbehind: + case lookbehind_not: + { + int mcnt, count; + boolean not =3D (re_opcode_t) *(p - 1) !=3D lookbehind; + + EXTRACT_NUMBER_AND_INCR (mcnt, p); + EXTRACT_NUMBER_AND_INCR (count, p); + + DEBUG_PRINT2 (not + ? "EXECUTING lookbehind_not %d.\n" + : "EXECUTING lookbehind %d.\n", count); +=20=20=20=20=20=20=20=20=20=20=20=20 + dfail =3D d; + while (d !=3D string1 && count > 0) + { + if (d =3D=3D string2) + { + if (!string1) + break; + d =3D end1; + dend =3D end_match_1; + } +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + if (target_multibyte) + { + re_char *dhead =3D (d >=3D string1 && d <=3D end1) ? s= tring1 : string2; + PREV_CHAR_BOUNDARY (d, dhead); + } + else + d--; + count--; + } + + if (count > 0) + { + if (not) + { + /* There is no enough string to match. + So just make it succeeded here. */ + d =3D dfail; + p =3D p - 2 + mcnt; + break; + } + else + goto fail; + } + + PUSH_FAILURE_POINT (p - 5, dfail); + } + break; + + case lookaround_succeed: + DEBUG_PRINT1 ("EXECUTING lookaround_succeed.\n"); +=20=20=20=20=20=20=20=20=20=20 + FINISH_LOOKAROUND(); + break; + + case lookaround_fail: + DEBUG_PRINT1 ("EXECUTING lookaround_fail.\n"); +=20=20=20=20=20=20=20=20=20=20 + FINISH_LOOKAROUND(); + goto fail; =20 /* \ has been turned into a `duplicate' command which is followed by the numeric value of as the register number. */ @@ -6413,12 +6707,16 @@ case on_failure_jump_loop: case on_failure_jump: case succeed_n: + case lookahead_not: + case lookbehind_not: d =3D str; continue_failure_jump: EXTRACT_NUMBER_AND_INCR (mcnt, pat); p =3D pat + mcnt; break; =20 + case lookahead: + case lookbehind: case no_op: /* A special frame used for nastyloops. */ goto fail; Test cases: ;; -*-coding:utf-8-*- (defvar test-counter 0) (defmacro test (&rest form) `(princ-list (format "%d ... " (setq test-counter (1+ test-counter))) (condition-case nil (if (progn ,@form) 'ok 'fail) (error 'invalid)))) (defun expect-invalid (regexp) (test (condition-case nil (prog1 nil (string-match regexp "")) (error t)))) (defun expect-match (regexp string &optional group-number group-string) (test (and (string-match regexp string) (if group-number (equal (match-string group-number string) group-string) t)))) (defun expect-not-match (regexp string) (test (not (string-match regexp string)))) (expect-match "\\(?=3D\\)" "") (expect-not-match "\\(?=3Da\\)" "") (expect-match "a\\(?=3Db\\)b" "ab") (expect-not-match "a\\(?=3Db\\)c" "ab") (expect-match "\\(?=3Da\\)a" "a") (expect-not-match "\\(?=3Db\\)a" "a") (expect-match "\\(?=3D^\\)a" "a") (expect-match "a\\(?=3D$\\)$" "a") (expect-match "a\\(?=3D\\)$" "a") (expect-match "a\\(?=3D.*c\\)b" "abc") (expect-not-match "a\\(?=3D.*d\\)b" "abc") (expect-match "a\\(?=3Db\\|c\\|d\\|e\\)" "ae") (expect-not-match "a\\(?=3Db\\|c\\|d\\|e\\)" "af") (expect-match "a\\(?=3D\\(b\\)\\)b" "ab" 1 "b") (expect-match "a\\(\\(?=3Db\\)\\)" "ab" 1 "") (expect-match "a\\(?=3D\\(b\\)\\)" "ab" 1 "b") (expect-match "\\(a\\(?=3D\\(b\\)\\)\\2\\)\\1" "abab" 1 "ab") (expect-not-match "\\(a\\)\\(?=3D\\(b\\)\\)\\1" "ab") (expect-match "\\(a\\(?=3Db\\(?=3Dc\\)\\)\\)" "abc" 1 "a") (expect-not-match "\\(a\\(?=3Db\\(?=3Dc\\)\\)\\)" "abd") (expect-not-match "\\(?!\\)" "") (expect-match "\\(?!a\\)" "") (expect-not-match "a\\(?!b\\)b" "ab") (expect-match "a\\(?!b\\)c" "ac") (expect-not-match "\\(?!a\\)a" "a") (expect-match "\\(?!b\\)a" "a") (expect-match "\\(?!^\\)a" "ba") (expect-not-match "\\(?!^\\)a" "a") (expect-not-match "a\\(?!$\\)$" "a") (expect-not-match "a\\(?!\\)$" "a") (expect-not-match "a\\(?!.*c\\)b" "abc") (expect-match "a\\(?!.*d\\)b" "abc") (expect-not-match "a\\(?!b\\|c\\|d\\|e\\)" "ae") (expect-match "a\\(?!b\\|c\\|d\\|e\\)" "af") (expect-match "a\\(?!\\(b\\)\\)c" "ac") (expect-match "a\\(\\(?!b\\)\\)" "ac") (expect-match "a\\(?!b\\(?!c\\)\\)" "abc") (expect-not-match "a\\(?!b\\(?=3D\\(c\\)\\)\\)" "abc") (expect-not-match "a\\(?!b\\(?!c\\)\\)" "abd") (expect-match "\\(?<=3D\\)" "") (expect-not-match "\\(?<=3Da\\)" "") (expect-match "\\(?<=3Da\\)" "a") (expect-not-match "\\(?<=3Db\\)" "a") (expect-match "\\(?<=3D^\\)" "") (expect-not-match "a\\(?<=3D^\\)" "") (expect-match "\\(?<=3D$\\)" "") (expect-not-match "\\(?<=3D$\\)a" "") (expect-match "\\(?<=3Da\\)b" "ab") (expect-not-match "\\(?<=3Dc\\)b" "ab") (expect-match "\\(?<=3D\\(?<=3Da\\)\\)b" "ab") (expect-not-match "\\(?<=3D\\(?<=3Db\\)\\)b" "ab") (expect-match "\\(?<=3D\\(?=3Da\\).\\)b" "ab") (expect-match "\\(?<=3D\\(a\\)\\)b\\1" "aba" 1 "a") (expect-match "\\(?<=3D.\\)a" "aa") (expect-match "\\(?<=3D\\(.\\)\\)a" "aa") (expect-match "\\(?<=3D\\w\\)a" "aa") (expect-not-match "\\(?<=3D\\w\\)a" "!a") (expect-match "\\(?<=3D\\sw\\)a" "aa") (expect-not-match "\\(?<=3D\\sw\\)a" "!a") (expect-match "\\(?<=3D\\cg\\)a" "=A6=CBa") (expect-not-match "\\(?<=3D\\Cg\\)a" "=A6=CBa") (expect-match "\\(?<=3D[a-z]\\)" "aa") (expect-not-match "\\(?<=3D[a-z]\\)a" "1a") (expect-match "\\(?<=3D[^a-z]\\)" "1a") (expect-not-match "\\(?<=3D[^a-z]\\)" "aa") (expect-match "\\(?<=3D[:ascii:]\\)a" "aa") (expect-match "\\(?<=3D\\`\\)" "") (expect-not-match "a\\(?<=3D\\`\\)" "a") (expect-match "\\(?<=3D\\'\\)" "") (expect-not-match "\\(?<=3D\\'\\)a" "a") (expect-not-match "\\(?<=3D\\=3D\\)" "") (expect-match "\\(?<=3D\\b\\)a" "a") (expect-not-match "a\\(?<=3D\\b\\)b" "ab") (expect-match "\\(?<=3D\\B\\)a" "aa") (expect-not-match "\\(?<=3D\\B\\)a" " a") (expect-match "\\(?<=3D\\<\\)a" "a") (expect-not-match "a\\(?<=3D\\<\\)b" "ab") (expect-match "a\\(?<=3D\\>\\)" "a") (expect-not-match "a\\(?<=3D\\>\\)b" "ab") (expect-match "\\(?<=3D\\_<\\)a" "a") (expect-not-match "a\\(?<=3D\\_<\\)b" "ab") (expect-match "a\\(?<=3D\\_>\\)" "a") (expect-not-match "a\\(?<=3D\\_>\\)b" "ab") (expect-invalid "\\(?<=3D\\(.\\)\\1\\)") ; duplicate (expect-invalid "\\(?<=3Da*\\)") ; variable width (expect-invalid "\\(?<=3Da*?\\)") ; variable width (expect-invalid "\\(?<=3Da+\\)") ; variable width (expect-invalid "\\(?<=3Da+?\\)") ; variable width (expect-invalid "\\(?<=3Da?\\)") ; variable width (expect-invalid "\\(?<=3Da??\\)") ; variable width (expect-invalid "\\(?<=3Da\\{1,4\\}\\)") ; variable width (expect-invalid "\\(?<=3Da\\|bb\\|ccc\\)") ; variable width (expect-invalid "\\(?<=3Da\\{4\\}\\)") ; fixed width but not supported yet (expect-invalid "\\(?<=3Da\\|\\b\\c\\)") ; fixed width but not supported = yet (expect-not-match "\\(?\\)" "a") (expect-match "a\\(?\\)b" "ab") (expect-not-match "\\(?\\)" "a") (expect-match "a\\(?\\)b" "ab") (expect-invalid "\\(?) id 1hgYPN-0004Av-9G for submit@debbugs.gnu.org; Thu, 27 Jun 2019 13:42:05 -0400 Received: from quimby.gnus.org ([80.91.231.51]:46124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgYPM-0004Am-9T for 5393@debbugs.gnu.org; Thu, 27 Jun 2019 13:42:04 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgYPH-0008DS-Eh; Thu, 27 Jun 2019 19:42:01 +0200 From: Lars Ingebrigtsen To: Stephen Berman Subject: Re: bug#5393: control message for bug 5393 References: <87twkts694.fsf@gnus.org> <87h9gtdtci.fsf@gmx.net> <874mcs45ao.fsf@gnus.org> Date: Thu, 27 Jun 2019 19:41:59 +0200 In-Reply-To: <874mcs45ao.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 29 Feb 2016 13:30:07 +1100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: The original suggestion was: --- I have attached a patch that enables you to use lookaround assertion in regexp with following syntax: Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 5393 Cc: Glenn Morris , 5393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The original suggestion was: --- I have attached a patch that enables you to use lookaround assertion in regexp with following syntax: * Positive lookahead assertion \(?=...\) * Negative lookahead assertion \(?!...\) * Positive lookbehind assertion \(?<=...\) * Negative lookbehind assertion \(?) id 1hgZtV-0006zo-5U for submit@debbugs.gnu.org; Thu, 27 Jun 2019 15:17:17 -0400 Received: from mail1421c50.megamailservers.eu ([91.136.14.21]:44570 helo=mail102c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgZtS-0006t2-Mj for 5393@debbugs.gnu.org; Thu, 27 Jun 2019 15:17:15 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1561663028; bh=MV+ihWzhmdqE8GmfcT1Tt/saLeO4TWfHjZZ1yxeRH1s=; h=From:Subject:Date:To:From; b=Bk5vCefk8Zg0MjSvdzpxVqu2KuUoztc0jMa55IY/lmvlxP1dGMXOLrxgfGQo4Qbsy +ZHcGT/KEMq92SbKWNuyFdzhBjNJtqnCXxbdUDg9zIuieWp4i3ocJFon1R6e6FjpPN djX96q7uCQV6j/O0dYKMYVH9CP6B5b/Zd4HzzdwU= Feedback-ID: mattiase@acm.or Received: from [192.168.1.65] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail102c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x5RJH60M013493; Thu, 27 Jun 2019 19:17:07 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Patch for lookaround assertion in regexp Message-Id: Date: Thu, 27 Jun 2019 21:17:05 +0200 To: Lars Ingebrigtsen , stephen.berman@gmx.net, rgm@gnu.org, 5393@debbugs.gnu.org, t.matsuyama.pub@gmail.com X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0205.5D151634.0007, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=RfS+9Wlv c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=kj9zAlcOel0A:10 a=1eQd1FuWHtpiRMpZeMAA:9 a=CjuIK1q_8ugA:10 X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 5393 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >That looks pretty cool to me, but there was next to no discussion about = this at the time (2009), which is a bit odd...=20 Didn't see it until now myself, and it looks useful, but perhaps it's = unwise to add features that couldn't easily make it into a DFA-based = engine. Positive lookahead maybe, the rest probably not. (The old engine = would need to be kept around for backrefs, but those are fairly rare in = actual use.) From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 14 09:16:06 2020 Received: (at 5393) by debbugs.gnu.org; 14 Aug 2020 13:16:06 +0000 Received: from localhost ([127.0.0.1]:52181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6ZZ0-00054d-C8 for submit@debbugs.gnu.org; Fri, 14 Aug 2020 09:16:06 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6ZYy-00053k-Ej for 5393@debbugs.gnu.org; Fri, 14 Aug 2020 09:16:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xRVx0QjEGBhJOlN7p4z9lIheaYf4QAR9nIECOrPnMI4=; b=d6Oh4KtjBfIX3mwxWqjePfDpLz Htp8DNZCiM60+YXl8IbQIuHtoig35zSmd6m85OoUGKkn/zc+lJEfzlruPTTw54vzTWqq71kvAcOMB f3+6IFSDnGC43JDOJQP5nKpB3UgCSkOW3wOcoerQbQUcfwmK9PdX618V+0FNrDKVnbo8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6ZYp-0002Dt-5z; Fri, 14 Aug 2020 15:15:57 +0200 From: Lars Ingebrigtsen To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#5393: Patch for lookaround assertion in regexp References: Date: Fri, 14 Aug 2020 15:15:53 +0200 In-Reply-To: ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Thu, 27 Jun 2019 21:17:05 +0200") Message-ID: <87pn7t74hi.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Mattias EngdegÄrd writes: >>That looks pretty cool to me, but there was next to no discussion > about this at the time (2009), which is a bit odd... > > Didn't see it until now myself, and it looks useful, but perhaps it's > u [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 5393 Cc: rgm@gnu.org, 5393@debbugs.gnu.org, stephen.berman@gmx.net, t.matsuyama.pub@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=C3=A5rd writes: >>That looks pretty cool to me, but there was next to no discussion > about this at the time (2009), which is a bit odd... > > Didn't see it until now myself, and it looks useful, but perhaps it's > unwise to add features that couldn't easily make it into a DFA-based > engine. Positive lookahead maybe, the rest probably not. (The old > engine would need to be kept around for backrefs, but those are fairly > rare in actual use.) Right. Well, there doesn't seem to be much enthusiasm for this patch, and it doesn't apply (not only because the file names have changed, but also other changes in the code), so I'm closing this bug report. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 14 09:16:13 2020 Received: (at control) by debbugs.gnu.org; 14 Aug 2020 13:16:13 +0000 Received: from localhost ([127.0.0.1]:52184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6ZZ7-00054x-Kt for submit@debbugs.gnu.org; Fri, 14 Aug 2020 09:16:13 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6ZZ5-00054e-OK for control@debbugs.gnu.org; Fri, 14 Aug 2020 09:16:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5SlhUF3pfCvFh71ZgZBRMRQxvPvR7cWeRo49Khx3tkY=; b=sGWuspBHt8K9Z7IEgx0cJ0wS7O 1e+bGgVIaGKZxe5TLgSgyM5/FiCVLwCzx5lzfV1NKtVeekcgI0UVlL6bKcpjJBrafqzb/xHik+uEa +J7aq6BipIFgABnBq+aR0iuRBeKoKfbSW07lvukZxEzAE75XMrcLOIWoteUxRtHaw8jw=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6ZYx-0002E8-W3 for control@debbugs.gnu.org; Fri, 14 Aug 2020 15:16:06 +0200 Date: Fri, 14 Aug 2020 15:16:02 +0200 Message-Id: <87o8nd74h9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #5393 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 5393 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 5393 quit From unknown Tue Jun 17 01:26:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 12 Sep 2020 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator