From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: rx.el sexp regexp syntax Date: Thu, 31 May 2018 10:19:02 -0400 Message-ID: References: <87h8mw3yoc.fsf@gmail.com> <20180525155126.GA4096@ACM> <87lgc7hebk.fsf@gmail.com> <87r2lzd375.fsf@ericabrahamsen.net> <8736ybpwhh.fsf@gmail.com> <87y3g1a9kv.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1527776289 6624 195.159.176.226 (31 May 2018 14:18:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 31 May 2018 14:18:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 31 16:18:05 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOOOx-0001cc-RY for ged-emacs-devel@m.gmane.org; Thu, 31 May 2018 16:18:03 +0200 Original-Received: from localhost ([::1]:44365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOOR4-0007jS-K8 for ged-emacs-devel@m.gmane.org; Thu, 31 May 2018 10:20:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOOQ6-0007j8-51 for emacs-devel@gnu.org; Thu, 31 May 2018 10:19:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOOQ2-0002mR-V9 for emacs-devel@gnu.org; Thu, 31 May 2018 10:19:14 -0400 Original-Received: from [195.159.176.226] (port=58453 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOOQ2-0002lL-NC for emacs-devel@gnu.org; Thu, 31 May 2018 10:19:10 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fOONs-0000Fh-QB for emacs-devel@gnu.org; Thu, 31 May 2018 16:16:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:wvW2rJzGEiG13j3DI477OgAm+CU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:225848 Archived-At: > Itʼs not clear to me how you'd do that. Looking at rx-constituents, > quite a few of the verbose ways of specifying what to match already > have a succinct version, eg > > sequence => and > zero-or-more => * The verbosity for me is not so much in the identifier as in the "( ID SPC ) SPC" and the need for quotation marks to surround actual characters. So for example the string's single-char * turns into a 5-char * in RX. I really like the regularity, extensibility, and clear structure of RX, but in practice it makes the regexps too long: short regexps are simple enough that RX's advantages don't get a chance to shine, and more complex regexps are made to spread too many lines for comfort. That doesn't mean I don't like RX, by the way. Just that I expected I'd really love it, and in the end I never use it because I never find it to be significantly better (I do think it's significantly better when you need to manipulate it programmatically, of course, which is why lex.el takes an RX syntax as input). Stefan PS: By the way, we should deprecate the `and` shorthand for `sequence`, because `and` in regexps could also mean "conjunction" (that's what it means in lex.el).