From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: phs Newsgroups: gmane.emacs.devel Subject: More re odditie [Was: regular expressions that match nothing] Date: Thu, 16 May 2019 08:57:18 +0200 Organization: CNRS & ENS Paris Saclay Message-ID: <84fcfdce-39d7-1ebb-c0c7-98aa05854646@lsv.fr> References: <7a6b23f52418b093a4cf7a6db4306cf425533249.camel@acm.org> <87a7fnzd3u.fsf@web.de> <128EBFB8-78FF-47C3-8F28-C1EF91BFC4BB@acm.org> Reply-To: phs@lsv.fr Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="114351"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Cc: Michael Heerdegen , Stefan Monnier , emacs-devel@gnu.org To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 16 15:02:04 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 1hRG1J-000TY9-DH for ged-emacs-devel@m.gmane.org; Thu, 16 May 2019 15:02:01 +0200 Original-Received: from localhost ([127.0.0.1]:55086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRG1I-0003Bv-D3 for ged-emacs-devel@m.gmane.org; Thu, 16 May 2019 09:02:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRAKV-0004pI-09 for emacs-devel@gnu.org; Thu, 16 May 2019 02:57:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRAKU-0002ZC-2n for emacs-devel@gnu.org; Thu, 16 May 2019 02:57:26 -0400 Original-Received: from olive.lsv.fr ([138.231.81.248]:43736 helo=olive.lsv.ens-cachan.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRAKR-0002Sx-Uc for emacs-devel@gnu.org; Thu, 16 May 2019 02:57:25 -0400 Original-Received: from brol.lsv.fr (brol.lsv.fr [138.231.81.57]) by olive.lsv.ens-cachan.fr (Postfix) with ESMTP id BCBC84C0186; Thu, 16 May 2019 08:57:18 +0200 (CEST) Openpgp: preference=signencrypt Autocrypt: addr=phs@lsv.fr; prefer-encrypt=mutual; keydata= mQINBFBXOYABEADaoNODK+BwbRfymBJhplueXfR527vDCce7qWC8foYu/tSEjRy5Nplpfetm 1foD5I7sM/DwDIKXUg2jP4z8LTMZJovdHGFV4SXAAx4aeZF3awHPaaTPwL8SVy5mraAB1oa2 cPu9C1n0M+l9Hm2x2RosglOziXVDSXLXj0+OSglmbsFLF0t3iHYCXN2PrXUFS2ZJFGDHU5t2 6Pw92TmvJ93OvoSCueRXwx4YKC/ipx+66tmWyHXtYdgeVieSK2794SzDbEp+sdzHICK/uQPw eFbw5lSaP9LczSN9cwFtWea+ZACkfWLvaHDrR4nabS2xDhf3uo2DiHs80ZYcpjzE2915D+QE zSsKGJB4vdiMmRDkzqU8Fbc0rZmMSl0360lJlsfyEo94/thxvENBeWb2ysLgmPl1k9YCmOlN 4FoIoM8KT+jwK2XRiJvfCc1I4f+ei8okATEesI3V8jH+adBtwof0C3RH8ITUGBA04bOjk+RV KU2yRhrWh4na4WDJlFueOgsBizh9t8wv6c9GoZ3B+144rR7lyVXB1SAE0a+e+sE89VH8bw/6 su1RxUfFHpo3vYQtCdDMviC8L+BTKje9Sc3QmAy8E98/qlAQQRuI6otGNp8zx0uOkremy+d1 7st8iEKI1Z//OZe8XSaMoWEdCVWNNTGp8Cr5QlLBeKK1VQgoQQARAQABtCxQaGlsaXBwZSBT Y2hub2ViZWxlbiA8cGhzQGxzdi5lbnMtY2FjaGFuLmZyPokCPwQTAQIAKQUCUFc5gAIbAwUJ HDIEgAcLCQgHAwIBBhUIAgkKC In-Reply-To: <128EBFB8-78FF-47C3-8F28-C1EF91BFC4BB@acm.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 138.231.81.248 X-Mailman-Approved-At: Thu, 16 May 2019 09:00:04 -0400 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:236574 Archived-At: While testing how rx handles the new regexp-unmatchable construct, I stumbled on some odd emacs behavior. The regular expression "*", instead of matching zero-or-more occurrences of the empty string, behaves as "\*" or "[*]" and only matches the * character. I believe this is a bug, not a feature, and in any case the Emacs manual does not document this behavior. Perhaps it is not a bug in Emacs per se, rather a bug in the gnulib regex library so I'll wait for comments before submitting a bug report... If this behavior is the expected one, then (rx (0+ "")) should not return "*". We have the same problem with "+" and (rx (1+ "")). -phs On 2019/05/15 23:07, Mattias Engdeg=E5rd wrote: > 15 maj 2019 kl. 22.17 skrev Michael Heerdegen : >> Should there be an rx regexp form for this? > We don't necessarily need a special form for it; we can just make `(or)= ' work. > > Proposed patch attached. (I also added its dual, (seq), since it would = be silly not to.) >