help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Finding C style comments using isearch-forward-regexp


From: Stefan Monnier <address@hidden>
Subject: Re: Finding C style comments using isearch-forward-regexp
Date: 20 Feb 2003 18:52:52 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>> It will avoid matching past the comment-end, but it doesn't prevent the
>> regexp routines from pushing stuff on the stack in case we need
>> to backtrack (the routines are not clever enough).
> Hm.  Does that mean that even, say, .* on a file with a single very
> long line will put too much stuff on the stack?

Depends.  ".*\n" or ".*$" will not because the regexp routines recognize
this case and don't push anything on the stack for it, but
".*(" will definitely push stuff and will thus lead to the same
error if the line is long enough.

> Is there a way to tell the routines to never backtrack?  I think
> there is a way for Perl, and Perlish things went into the Emacs
> regexp engine...

Perl has a way to throw away part of the stack frames (it's basically
equivalent to the `!' construct of Prolog, a.k.a. cut).
It's not implemented in Emacs.


        Stefan


reply via email to

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