From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Dziulko Newsgroups: gmane.emacs.help Subject: Re: Finding C style comments using isearch-forward-regexp Date: Fri, 21 Feb 2003 09:00:09 -0500 (EST) Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <84smui7igx.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1045836449 29431 80.91.224.249 (21 Feb 2003 14:07:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 21 Feb 2003 14:07:29 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18mDpk-0007eJ-00 for ; Fri, 21 Feb 2003 15:07:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18mDnm-0005Qi-04 for gnu-help-gnu-emacs@m.gmane.org; Fri, 21 Feb 2003 09:05:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18mDmC-0004Rm-00 for help-gnu-emacs@gnu.org; Fri, 21 Feb 2003 09:03:44 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18mDjo-0003kq-00 for help-gnu-emacs@gnu.org; Fri, 21 Feb 2003 09:01:19 -0500 Original-Received: from klaatu.canisius.edu ([138.92.8.100]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18mDil-0003ea-00 for help-gnu-emacs@gnu.org; Fri, 21 Feb 2003 09:00:11 -0500 Original-Received: from localhost (dziulko@localhost) by klaatu.canisius.edu (8.11.6/8.11.6) with ESMTP id h1LE09901593 for ; Fri, 21 Feb 2003 09:00:09 -0500 Original-To: help-gnu-emacs@gnu.org In-Reply-To: <84smui7igx.fsf@lucy.is.informatik.uni-duisburg.de> X-MIME-Autoconverted: from 8bit to quoted-printable by klaatu.canisius.edu id h1LE09901593 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6976 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6976 On Thu, 20 Feb 2003, Kai Gro=DFjohann wrote: > "Stefan Monnier " writes: >=20 > >> - any sequence of [^*] is allowed > >> - a * followed by [^/] is allowed > >> The above two can be repeated. > >> I think that avoids backtracking. > > > > It will avoid matching past the comment-end, but it doesn't prevent t= he > > regexp routines from pushing stuff on the stack in case we need > > to backtrack (the routines are not clever enough). >=20 > Hm. Does that mean that even, say, .* on a file with a single very > long line will put too much stuff on the stack? >=20 > 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... >=20 The regexp /*[^\(*/\)]*/ will find C comments in a non-greedy fashion. Does this help your stack problems?