unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Alexander V. Lukyanov" <lav@netis.ru>
To: bug-gnu-emacs@gnu.org
Subject: bug#1260: regex.c and RE_FRUGAL
Date: Mon, 27 Oct 2008 18:56:11 +0300	[thread overview]
Message-ID: <20081027155611.GA7082@night.netis.ru> (raw)

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,&regs)==-1) {
      printf("search failed\n");
      return 1;
   }
   printf("%d-%d\n",regs.start[0],regs.end[0]);
   return 0;
}

--
   Alexander.







             reply	other threads:[~2008-10-27 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwvmygo23nk.fsf-monnier+emacsbugreports@gnu.org>
2008-10-27 15:56 ` Alexander V. Lukyanov [this message]
2008-10-28  8:17   ` bug#1260: regex.c and RE_FRUGAL 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081027155611.GA7082@night.netis.ru \
    --to=lav@netis.ru \
    --cc=1260@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).