From lav@netis.ru Mon Oct 27 08:56:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.0 required=4.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Oct 2008 15:56:35 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9RFuURl012919 for ; Mon, 27 Oct 2008 08:56:32 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KuUSE-0002qB-K0 for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2008 11:56:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KuUSD-0002px-Qr for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2008 11:56:30 -0400 Received: from [199.232.76.173] (port=33503 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KuUSD-0002pm-Ci for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2008 11:56:29 -0400 Received: from star.netis.ru ([213.187.127.146]:47399) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KuUSC-0002Io-U0 for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2008 11:56:29 -0400 Received: from night.yars.free.net (night.yars.free.net [193.233.48.54]) by star.netis.ru (8.14.2/8.14.2) with ESMTP id m9RFtvB0013939 for ; Mon, 27 Oct 2008 18:56:00 +0300 Received: (from lav@localhost) by night.yars.free.net (8.11.6+Sun/8.11.6) id m9RFuCn07085 for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2008 18:56:12 +0300 (MSK) X-Authentication-Warning: night.yars.free.net: lav set sender to lav@netis.ru using -f Date: Mon, 27 Oct 2008 18:56:11 +0300 From: "Alexander V. Lukyanov" To: bug-gnu-emacs@gnu.org Subject: regex.c and RE_FRUGAL Message-ID: <20081027155611.GA7082@night.netis.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11 X-NETIS-MailScanner-Information: Please contact NETIS Telecom for more information (+7 4852 797797) X-NETIS-MailScanner-ID: m9RFtvB0013939 X-NETIS-MailScanner: Found to be clean X-NETIS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0, required 6, autolearn=disabled) X-NETIS-MailScanner-From: lav@netis.ru X-NETIS-MailScanner-To: bug-gnu-emacs@gnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Hello! This bug report is not quite for emacs, but for its regex library. It features RE_FRUGAL flag (very useful), but it does not seem to work. I have tried this rather simple program and it prints 0-12 instead of expected 0-6. Please advice. #include "config.h" #include #include #include #include "regex.h" int main() { const char *rexp="<.*?>"; static struct re_pattern_buffer rexp_c; static struct re_registers regs; re_syntax_options = RE_FRUGAL; re_compile_pattern(rexp,strlen(rexp),&rexp_c); if(re_search(&rexp_c,"",12,0,12,®s)==-1) { printf("search failed\n"); return 1; } printf("%d-%d\n",regs.start[0],regs.end[0]); return 0; } -- Alexander. From monnier@iro.umontreal.ca Tue Oct 28 01:18:02 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Oct 2008 08:18:02 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9S8HwiA029302 for ; Tue, 28 Oct 2008 01:18:00 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kujm1-0004sK-FZ for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 04:17:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kujlw-0004pZ-7X for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 04:17:56 -0400 Received: from [199.232.76.173] (port=35910 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kujlw-0004pT-01 for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 04:17:52 -0400 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:60537 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kujlv-0001wS-LR for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 04:17:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhAFAGpnBklMCqyo/2dsb2JhbACBdsYcg0+BDQ X-IronPort-AV: E=Sophos;i="4.33,497,1220241600"; d="scan'208";a="28947956" Received: from 76-10-172-168.dsl.teksavvy.com (HELO pastel.home) ([76.10.172.168]) by ironport2-out.teksavvy.com with ESMTP; 28 Oct 2008 04:17:45 -0400 Received: by pastel.home (Postfix, from userid 20848) id 37CD78E6F; Tue, 28 Oct 2008 04:17:45 -0400 (EDT) From: Stefan Monnier To: "Alexander V. Lukyanov" Cc: 1260@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#1260: regex.c and RE_FRUGAL Message-ID: References: <20081027155611.GA7082@night.netis.ru> Date: Tue, 28 Oct 2008 04:17:45 -0400 In-Reply-To: <20081027155611.GA7082@night.netis.ru> (Alexander V. Lukyanov's message of "Mon, 27 Oct 2008 18:56:11 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 > This bug report is not quite for emacs, but for its regex library. > It features RE_FRUGAL flag (very useful), but it does not seem to work. > I have tried this rather simple program and it prints 0-12 instead of > expected 0-6. IIRC you'll need to set RE_NO_POSIX_BACKTRACKING as well, otherwise the match returned will always be the longest. Stefan From lav@netis.ru Tue Oct 28 04:58:33 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.2 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Oct 2008 11:58:33 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9SBwMQX018511 for ; Tue, 28 Oct 2008 04:58:23 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KunDJ-00075A-QW for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 07:58:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KunDH-00073T-Nt for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 07:58:20 -0400 Received: from [199.232.76.173] (port=43968 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KunDH-00073G-9c for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 07:58:19 -0400 Received: from star.netis.ru ([213.187.127.146]:36796) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KunDG-0006qG-FO for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2008 07:58:19 -0400 Received: from night.yars.free.net (night.yars.free.net [193.233.48.54]) by star.netis.ru (8.14.2/8.14.2) with ESMTP id m9SBvQFp015933; Tue, 28 Oct 2008 14:57:28 +0300 Received: (from lav@localhost) by night.yars.free.net (8.11.6+Sun/8.11.6) id m9SBvdd07728; Tue, 28 Oct 2008 14:57:39 +0300 (MSK) X-Authentication-Warning: night.yars.free.net: lav set sender to lav@netis.ru using -f Date: Tue, 28 Oct 2008 14:57:39 +0300 From: "Alexander V. Lukyanov" To: Stefan Monnier Cc: 1260@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#1260: regex.c and RE_FRUGAL Message-ID: <20081028115739.GA7702@night.netis.ru> References: <20081027155611.GA7082@night.netis.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 X-NETIS-MailScanner-Information: Please contact NETIS Telecom for more information (+7 4852 797797) X-NETIS-MailScanner-ID: m9SBvQFp015933 X-NETIS-MailScanner: Found to be clean X-NETIS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0, required 6, autolearn=disabled) X-NETIS-MailScanner-From: lav@netis.ru X-NETIS-MailScanner-To: 1260@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org, monnier@iro.umontreal.ca X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) On Tue, Oct 28, 2008 at 04:17:45AM -0400, Stefan Monnier wrote: > > This bug report is not quite for emacs, but for its regex library. > > It features RE_FRUGAL flag (very useful), but it does not seem to work. > > I have tried this rather simple program and it prints 0-12 instead of > > expected 0-6. > > IIRC you'll need to set RE_NO_POSIX_BACKTRACKING as well, otherwise the > match returned will always be the longest. Thank you! The flag RE_NO_POSIX_BACKTRACKING did the trick. Is there a reason for RE_SYNTAX_EMACS including RE_FRUGAL and not including RE_NO_POSIX_BACKTRACKING? -- Alexander. From monnier@iro.umontreal.ca Tue Oct 28 07:31:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.0 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1260-done) by emacsbugs.donarmstrong.com; 28 Oct 2008 14:31:43 +0000 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9SEVZuh024938 for <1260-done@emacsbugs.donarmstrong.com>; Tue, 28 Oct 2008 07:31:36 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhAFAH2/BklMCqyo/2dsb2JhbACBdsgfg0+BDQ X-IronPort-AV: E=Sophos;i="4.33,499,1220241600"; d="scan'208";a="28958410" Received: from 76-10-172-168.dsl.teksavvy.com (HELO pastel.home) ([76.10.172.168]) by ironport2-out.teksavvy.com with ESMTP; 28 Oct 2008 10:31:29 -0400 Received: by pastel.home (Postfix, from userid 20848) id 9D60E8E6F; Tue, 28 Oct 2008 10:31:29 -0400 (EDT) From: Stefan Monnier To: "Alexander V. Lukyanov" Cc: 1260-done@debbugs.gnu.org Subject: Re: bug#1260: regex.c and RE_FRUGAL Message-ID: References: <20081027155611.GA7082@night.netis.ru> <20081028115739.GA7702@night.netis.ru> Date: Tue, 28 Oct 2008 10:31:29 -0400 In-Reply-To: <20081028115739.GA7702@night.netis.ru> (Alexander V. Lukyanov's message of "Tue, 28 Oct 2008 14:57:39 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >> > This bug report is not quite for emacs, but for its regex library. >> > It features RE_FRUGAL flag (very useful), but it does not seem to work. >> > I have tried this rather simple program and it prints 0-12 instead of >> > expected 0-6. >> >> IIRC you'll need to set RE_NO_POSIX_BACKTRACKING as well, otherwise the >> match returned will always be the longest. > Thank you! The flag RE_NO_POSIX_BACKTRACKING did the trick. > Is there a reason for RE_SYNTAX_EMACS including RE_FRUGAL and not including > RE_NO_POSIX_BACKTRACKING? Emacs passes RE_NO_POSIX_BACKTRACKING explicitly depending on whether it wants posix behavior or not (it has matching functions like "string-match" and "posix-string-match"). Stefan From unknown Sun Sep 21 08:31:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Tue, 25 Nov 2008 15:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator