From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#37659: rx additions: anychar, unmatchable, unordered-or Date: Wed, 23 Oct 2019 16:14:45 -0700 Organization: UCLA Computer Science Department Message-ID: <9016eb3d-7d58-5950-862a-13db4c7ff32b@cs.ucla.edu> References: <88571301-3F15-428F-82F9-60A23D817EF8@acm.org> <1A5B8E3D-B147-4B89-BFAE-50DCB0A64D3B@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="131290"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 Cc: 37659@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 24 01:15:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iNPqX-000Y1C-5i for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Oct 2019 01:15:17 +0200 Original-Received: from localhost ([::1]:52464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNPqV-0004DE-Ly for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2019 19:15:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34579) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNPqJ-0003yc-4O for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 19:15:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNPqI-0003mC-6W for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 19:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNPqI-0003m3-3D for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 19:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iNPqH-0001S9-Tw for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 19:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Oct 2019 23:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37659 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37659-submit@debbugs.gnu.org id=B37659.15718724965562 (code B ref 37659); Wed, 23 Oct 2019 23:15:01 +0000 Original-Received: (at 37659) by debbugs.gnu.org; 23 Oct 2019 23:14:56 +0000 Original-Received: from localhost ([127.0.0.1]:35168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNPqC-0001Re-Cl for submit@debbugs.gnu.org; Wed, 23 Oct 2019 19:14:56 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNPq9-0001RP-5N for 37659@debbugs.gnu.org; Wed, 23 Oct 2019 19:14:54 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A005E1606CB; Wed, 23 Oct 2019 16:14:46 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FoRcQZ0Hz4bT; Wed, 23 Oct 2019 16:14:46 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EA4F31606CD; Wed, 23 Oct 2019 16:14:45 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id m_Cs7E8ZB-_e; Wed, 23 Oct 2019 16:14:45 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id D18671606CB; Wed, 23 Oct 2019 16:14:45 -0700 (PDT) In-Reply-To: <1A5B8E3D-B147-4B89-BFAE-50DCB0A64D3B@acm.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170106 Archived-At: On 10/23/19 2:15 AM, Mattias Engdeg=C3=A5rd wrote: > how do we make it easy to match one of multiple strings --- keywords, s= ay --- in rx? If that's the real problem, perhaps the name should be "or-tokens" or=20 something like that, to help remind the reader of the limitations of the=20 proposed operator: it's meant only for greedy tokenization and it isn't=20 suited for regular expressions in general. A problem with the name=20 "or-max" is that it implies a more-general functionality than the=20 implementation really has. What happens if you apply or-tokens to arguments that aren't strings or=20 other or-tokens? Does rx diagnose this? I hope it does. > We could say that 'or' and \| either match greedily or in left-to-right= order. However, I'm not sure this solves any problem right now. I was thinking of something more-compatible: we could say that \| is=20 left-to-right (for users who need compatibility with regexp "|"), and=20 that 'or' is not necessarily left-to-right (to make room for future=20 extensions that make 'or' greedy, or more efficient, or both).