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: Kai Großjohann
Subject: Re: Finding C style comments using isearch-forward-regexp
Date: Thu, 20 Feb 2003 08:19:21 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50

"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> 
writes:

>>>>>> "Timur" == Timur Aydin <timuraydin@superonline.com> writes:
>> Hmm, that seems like a workaround. But the mentioned regexp not
>> working indicates a bug in the emacs regexp handler, doesn't it?
>
> A shortcoming, yes, a bug, I don't think so: it's inherent to the
> technique used to do the matching (i.e. backtracking).

Maybe one can work around it by constructing the regexp differently:
instead of allowing any character sequence between "/*" and "*/", one
restricts the possible sequences, with the following idea:

- any sequence of [^*] is allowed
- a * followed by [^/] is allowed

The above two can be repeated.

I think that avoids backtracking.
-- 
A preposition is not a good thing to end a sentence with.


reply via email to

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