* bug#1260: regex.c and RE_FRUGAL
@ 2008-10-27 15:56 ` Alexander V. Lukyanov
2008-10-28 8:17 ` Stefan Monnier
2008-10-28 14:40 ` bug#1260: marked as done (regex.c and RE_FRUGAL) Emacs bug Tracking System
0 siblings, 2 replies; 4+ messages in thread
From: Alexander V. Lukyanov @ 2008-10-27 15:56 UTC (permalink / raw
To: bug-gnu-emacs
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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#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,"<html><head>",12,0,12,®s)==-1) {
printf("search failed\n");
return 1;
}
printf("%d-%d\n",regs.start[0],regs.end[0]);
return 0;
}
--
Alexander.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#1260: regex.c and RE_FRUGAL
2008-10-27 15:56 ` bug#1260: regex.c and RE_FRUGAL Alexander V. Lukyanov
@ 2008-10-28 8:17 ` Stefan Monnier
2008-10-28 11:57 ` Alexander V. Lukyanov
2008-10-28 14:40 ` bug#1260: marked as done (regex.c and RE_FRUGAL) Emacs bug Tracking System
1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2008-10-28 8:17 UTC (permalink / raw
To: Alexander V. Lukyanov; +Cc: bug-gnu-emacs, 1260
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#1260: regex.c and RE_FRUGAL
2008-10-28 8:17 ` Stefan Monnier
@ 2008-10-28 11:57 ` Alexander V. Lukyanov
0 siblings, 0 replies; 4+ messages in thread
From: Alexander V. Lukyanov @ 2008-10-28 11:57 UTC (permalink / raw
To: Stefan Monnier; +Cc: bug-gnu-emacs, 1260
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#1260: marked as done (regex.c and RE_FRUGAL)
2008-10-27 15:56 ` bug#1260: regex.c and RE_FRUGAL Alexander V. Lukyanov
2008-10-28 8:17 ` Stefan Monnier
@ 2008-10-28 14:40 ` Emacs bug Tracking System
1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2008-10-28 14:40 UTC (permalink / raw
To: Stefan Monnier
[-- Attachment #1: Type: text/plain, Size: 835 bytes --]
Your message dated Tue, 28 Oct 2008 10:31:29 -0400
with message-id <jwvmygo23nk.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#1260: regex.c and RE_FRUGAL
has caused the Emacs bug report #1260,
regarding regex.c and RE_FRUGAL
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)
--
1260: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1260
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 3250 bytes --]
From: "Alexander V. Lukyanov" <lav@netis.ru>
To: bug-gnu-emacs@gnu.org
Subject: regex.c and RE_FRUGAL
Date: Mon, 27 Oct 2008 18:56:11 +0300
Message-ID: <20081027155611.GA7082@night.netis.ru>
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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#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,"<html><head>",12,0,12,®s)==-1) {
printf("search failed\n");
return 1;
}
printf("%d-%d\n",regs.start[0],regs.end[0]);
return 0;
}
--
Alexander.
[-- Attachment #3: Type: message/rfc822, Size: 2420 bytes --]
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Alexander V. Lukyanov" <lav@netis.ru>
Cc: 1260-done@emacsbugs.donarmstrong.com
Subject: Re: bug#1260: regex.c and RE_FRUGAL
Date: Tue, 28 Oct 2008 10:31:29 -0400
Message-ID: <jwvmygo23nk.fsf-monnier+emacsbugreports@gnu.org>
>> > 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-28 14:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <jwvmygo23nk.fsf-monnier+emacsbugreports@gnu.org>
2008-10-27 15:56 ` bug#1260: regex.c and RE_FRUGAL Alexander V. Lukyanov
2008-10-28 8:17 ` Stefan Monnier
2008-10-28 11:57 ` Alexander V. Lukyanov
2008-10-28 14:40 ` bug#1260: marked as done (regex.c and RE_FRUGAL) Emacs bug Tracking System
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.