[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack overflow in regexp matcher

From: Stefan Monnier
Subject: Re: Stack overflow in regexp matcher
Date: 16 Oct 2003 14:56:52 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> 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.


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 via email to

[Prev in Thread] Current Thread [Next in Thread]