From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Patch for lookaround assertion in regexp Date: Tue, 24 Jan 2012 09:40:38 -0500 Message-ID: References: <009001ccd9c0$9bde09f0$d39a1dd0$@cfraizer.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1327416075 7869 80.91.229.12 (24 Jan 2012 14:41:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Jan 2012 14:41:15 +0000 (UTC) Cc: emacs-devel@gnu.org, Colin Fraizer , t.matsuyama.pub@gmail.com To: Nikolai Weibull Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 24 15:41:11 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RphYb-0007TS-PU for ged-emacs-devel@m.gmane.org; Tue, 24 Jan 2012 15:41:09 +0100 Original-Received: from localhost ([::1]:36166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RphYb-0003u8-9Z for ged-emacs-devel@m.gmane.org; Tue, 24 Jan 2012 09:41:09 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RphYP-0003tG-T5 for emacs-devel@gnu.org; Tue, 24 Jan 2012 09:41:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RphYG-00016y-0d for emacs-devel@gnu.org; Tue, 24 Jan 2012 09:40:57 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:48553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RphYE-00015e-UK for emacs-devel@gnu.org; Tue, 24 Jan 2012 09:40:47 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q0OEecAO014042; Tue, 24 Jan 2012 09:40:39 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id BFC84B4431; Tue, 24 Jan 2012 09:40:38 -0500 (EST) In-Reply-To: (Nikolai Weibull's message of "Tue, 24 Jan 2012 09:41:11 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4110=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4110> : streams <722606> : uri <1052841> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147879 Archived-At: >>> In 2009, Tomohiro Matsuyama sent a message to this list with a patch >>> to add lookahead/lookbehind assertions to Emacs regular expressions >>> (regexps). =C2=A0Is there any plan to incorporate this useful feature i= nto >>> an official release? >> I'd like to replace the current regexp engine with one that does not >> suffer from exponential blowup (i.e. using "Thompson's NFA"). >> OTOH, noone has submitted code to replace the current regexp engine, and >> I don't forsee I'll have the time to write it myself, so maybe I should >> just give up on this plan. > As an alternative to PCRE, which, as has already been pointed out, > doesn=E2=80=99t match any of these requirements, how about RE2? > http://code.google.com/p/re2/ > It=E2=80=99s written in C++, which is a minus, but it should be simple en= ough > to extend it with \c and \s. That might work, indeed (tho someone still has to write the corresponding code). Note that it does not support lookaround assertions. Stefan