From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ilya Zakharevich Newsgroups: gmane.emacs.help Subject: Re: will we ever have zero width assertions in regexps? Date: Tue, 8 Feb 2011 22:41:18 +0000 (UTC) Organization: U.C. Berkeley Math. Department. Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1297208430 10096 80.91.229.12 (8 Feb 2011 23:40:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Feb 2011 23:40:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 09 00:40:26 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PmxAY-0000YA-0w for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Feb 2011 00:40:26 +0100 Original-Received: from localhost ([127.0.0.1]:55942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmxAX-0006U1-JA for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Feb 2011 18:40:25 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Injection-Date: Tue, 8 Feb 2011 22:41:18 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="LlLjF8LevGdIZWbTvv+SXA"; logging-data="15589"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Tl42lRyMyZ+Yv4PhNIrcx" User-Agent: slrn/0.9.8.1pl1 (Linux) Cancel-Lock: sha1:qr9N588vDAUfFn5wJWqL6nTeiIM= Original-Xref: usenet.stanford.edu gnu.emacs.help:184868 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79039 Archived-At: On 2011-02-07, Stefan Monnier wrote: >> Hmm, I thought about a different scenario: if the bit is set, then one >> switches to a DIFFERENT REx designed for a multi-line case. Otherwise >> why not just run it against the rest of the buffer, instead of >> one-line? > > Because we don't want to match those regexps against the whole buffer > every time the buffer is modified (the buffer may be large). I think there is some confusion here: I did not want to mean that you run "another REx" via re-search(), but via looking-at() at the corresponding position... Essentially: do you want the REx to start match on the current line, or end match on the current line? Or maybe you mean a different thing, and WANT e.g. [^a-z] to actually "mean" [^a-z\n] ? (So only an explicit non-negated \n in a REx may match \n in a buffer?) > BTW, another reason to want a non-backtracking matcher can be seen in > the recent thread "Stack overflow in regexp matcher". I think this is a red herring. Try to stack-overflow the Perl matcher... (Possible, but one must be very malicious to hit these situations.) Ilya