unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
Subject: Re: Stack overflow in regexp matcher
Date: 16 Oct 2003 14:56:52 -0400	[thread overview]
Message-ID: <jwvekxduicp.fsf-monnier+emacs/devel@vor.iro.umontreal.ca> (raw)
In-Reply-To: <u3cdt5efc.fsf@gnu.org>

> what this might mean?

Although, strictly speaking, regular expressions can be matched using
a finite-state machine, Emacs's regexp-matcher uses a backtracking matcher
and if the backtracking stack is too large you get a stack overflow.

In your case "nnfolder.*?sent" might work better.


        Stefan


PS: As for why not use a finite-state machine... well one of the reasons
    is that it's extra work, another is that Emacs's regexps aren't pure
    regular expressions (most obviously because of backrefs).
    Supposedly the latest glibc regexp code uses an FSM, and hopefully
    someone will hack on it at some point to make it useable for Emacs.
    In the mean time, you'll have to be careful with regexps to try and
    avoid excessive stack use.

  reply	other threads:[~2003-10-16 18:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-16 16:35 Stack overflow in regexp matcher Sam Steingold
2003-10-16 18:56 ` Stefan Monnier [this message]
2003-10-17  6:13   ` Stephen J. Turnbull
2003-10-17 13:55     ` Stefan Monnier
2003-10-17 14:24       ` Andreas Schwab

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=jwvekxduicp.fsf-monnier+emacs/devel@vor.iro.umontreal.ca \
    --to=monnier@iro.umontreal.ca \
    /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).