From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: will we ever have zero width assertions in regexps? Date: Thu, 27 Jan 2011 11:10:22 -0500 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296148098 5249 80.91.229.12 (27 Jan 2011 17:08:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 27 Jan 2011 17:08:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 27 18:08:15 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 1PiVKM-0000Si-UI for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Jan 2011 18:08:13 +0100 Original-Received: from localhost ([127.0.0.1]:42028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiUwQ-0002fW-GU for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Jan 2011 11:43:26 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Injection-Info: mx03.eternal-september.org; posting-host="6piQ/LSV2teABV1cl6J+lQ"; logging-data="4493"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GLxv+LKYUoEx5wcNuyXeP" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:Z2dGSrrtrm86LbWO6WjnOgDDKbg= sha1:QVfGVzrfLHTW3LojgsGWf2ORRkM= Original-Xref: usenet.stanford.edu gnu.emacs.help:184631 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:78787 Archived-At: >> similar to Lua's Lpeg. I myself would also be more interested in >> replacing the backtracking matcher with a non-backtracking one (for the >> cases where backtracking is not required by backrefs). > What for? [After my final round of backtracking-optimizations for > Perl REx engine, I do not recollect people (loudly) wanting anything > like this for Perl anymore...] To get rid of the occasional pathological case where matching takes forever and Emacs appears to be frozen. Programmers who are used to backtracking matchers will usually intuitively stay away from regexps that can show such behaviors, but not all programmers do, and even if you're careful there are cases that are hard to avoid. Another minor reason is that it can be handy to have an incremental matching primitive, so you can match over a long string one chunk at a time. I'm not sure how often this would be useful, but I've come across a few cases where it seemed like it could be put to good use (tho, for lack of experience with it, I can't sweat that it would turn out to be a good idea). Stefan