From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Fixing ill-conditioned regular expressions. Proof of concept. Date: Thu, 26 Feb 2015 16:21:19 +0000 Message-ID: <20150226162119.GD19320@acm.fritz.box> References: <20150223202114.GB2861@acm.fritz.box> <54EBA757.5030901@cs.ucla.edu> <20150223224245.GC2861@acm.fritz.box> <54EBB9C4.1020505@cs.ucla.edu> <20150225100834.GA3502@acm.fritz.box> <54EEDD82.4010502@cs.ucla.edu> <20150226101137.GA19320@acm.fritz.box> <87fv9tc4qm.fsf@gnu.org> <20150226130917.GC19320@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1424967740 28688 80.91.229.3 (26 Feb 2015 16:22:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Feb 2015 16:22:20 +0000 (UTC) Cc: Paul Eggert , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 26 17:22:12 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YR1CU-00086l-M0 for ged-emacs-devel@m.gmane.org; Thu, 26 Feb 2015 17:22:10 +0100 Original-Received: from localhost ([::1]:59735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YR1CT-00009d-Ow for ged-emacs-devel@m.gmane.org; Thu, 26 Feb 2015 11:22:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YR1CA-00086J-QQ for emacs-devel@gnu.org; Thu, 26 Feb 2015 11:21:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YR1C6-0007Jg-Qt for emacs-devel@gnu.org; Thu, 26 Feb 2015 11:21:50 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:54513 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YR1C6-0007Jc-Ez for emacs-devel@gnu.org; Thu, 26 Feb 2015 11:21:46 -0500 Original-Received: (qmail 90213 invoked by uid 3782); 26 Feb 2015 16:21:44 -0000 Original-Received: from acm.muc.de (pD951AF12.dip0.t-ipconnect.de [217.81.175.18]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 26 Feb 2015 17:21:43 +0100 Original-Received: (qmail 20594 invoked by uid 1000); 26 Feb 2015 16:21:19 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 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:183518 Archived-At: Hello, Stefan. On Thu, Feb 26, 2015 at 08:46:22AM -0500, Stefan Monnier wrote: > > I think that's true. There might be a slight problem with groups which > > match only the empty string. Something like: > > R*\(\)R* > > , but anybody who writes such regexps deserves what she gets. > What is it that I deserve to get? You deserve, perhaps, to lose (match-beginning 1) and (match-end 1), which were ill-defined anyway. You perhaps deserve to lose the entire empty group. Writing a regexp like that, you deserve pain. ;-) Have you really written a regexp like this (apart from for testing purposes)?. If so, what's it for? By the way, how do you see the prospects of this file becoming incorporated into Emacs at some stage? > Stefan -- Alan Mackenzie (Nuremberg, Germany).