From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: More re odditie [Was: regular expressions that match nothing] Date: Thu, 16 May 2019 08:31:20 -0400 Message-ID: References: <7a6b23f52418b093a4cf7a6db4306cf425533249.camel@acm.org> <87a7fnzd3u.fsf@web.de> <128EBFB8-78FF-47C3-8F28-C1EF91BFC4BB@acm.org> <84fcfdce-39d7-1ebb-c0c7-98aa05854646@lsv.fr> <4f88e61c-77d0-96fd-9deb-c35686757c99@lsv.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="38066"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Michael Heerdegen , Mattias =?windows-1252?Q?Engdeg=E5rd?= , emacs-devel@gnu.org To: phs Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 16 14:44:24 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRFkE-0009j7-It for ged-emacs-devel@m.gmane.org; Thu, 16 May 2019 14:44:22 +0200 Original-Received: from localhost ([127.0.0.1]:54268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRFkA-00050s-8L for ged-emacs-devel@m.gmane.org; Thu, 16 May 2019 08:44:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRFXk-0003Q0-61 for emacs-devel@gnu.org; Thu, 16 May 2019 08:31:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRFXh-0002aV-3d for emacs-devel@gnu.org; Thu, 16 May 2019 08:31:28 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59557) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRFXg-0002Zt-UK for emacs-devel@gnu.org; Thu, 16 May 2019 08:31:25 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D4DD21008B5; Thu, 16 May 2019 08:31:23 -0400 (EDT) Original-Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9E28B100870; Thu, 16 May 2019 08:31:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558009882; bh=HwFE8e1351XR9NL1kSbwtgfSPFN5X+ZbWq+PKBUHi3I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=kB9jufALXea31RFXyNYF6YemCN6FDVR+bPsbaRCYYxnB0mNKXYzG5TBEZQGarJWja eJcg1aSvpi7id1HrAP+1KFO1HQ0uzaUFIeWYubd7Q0mmDV+Ddz2QjjJ8HMbz+r081Q Kw/q3zaGYzCB4MSanvvP8nnr2JvU+ilWsraxrSJj8O6sBdUPLH8MGIMjk0B63icZpH 0oXk+n1rnBn5EWQruSJpFaf6tlfaORaqCF81gizlZ+ZV9K2X/qzLmA1Of3M0sD7zi7 fZlx+oRQEG6yxCf79OXgc4eB8NCfoRj2kJ/Zvb+VglXk+RvjOwhtnmbRdcoNq7Rqxa teE8GYMXnobBg== Original-Received: from ceviche (69-196-155-191.dsl.teksavvy.com [69.196.155.191]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id 5F188120B48; Thu, 16 May 2019 08:31:22 -0400 (EDT) In-Reply-To: <4f88e61c-77d0-96fd-9deb-c35686757c99@lsv.fr> (phs@lsv.fr's message of "Thu, 16 May 2019 12:59:19 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:236573 Archived-At: > I'd rather read `*' as meaning "repeat the empty string", `*` repeats the immediately preceding regular expression, but here there is no preceding regular expression: - there are various ways to resolve this problem. - all "reasonable" semantics are pretty useless in the sense that it's trivial to write another regexp with the same semantics. - the combination of the previous two points implies that signaling an error is probably the better option. > BTW, can your scans of regexps tell if this compatibility is relied on a > lot? His scan does catch those (and many other of its friends). > It would be safe to replace `*' and `+' with `\*' and `\+' where > this happens. We've done that, indeed. > I've just grep'ed quickly through the code and only noticed a risky > use of "+" (and "[..]") in the definition of `term-word' in term.el That's because we already fixed the occurrences that his tool finds ;-) >> Thanks for reporting it, and you are right, that's a (known) bug in rx. > When rx is fixed, I suggest we add the following extra tests (see patch) Good idea. Stefan