From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Peter Neidhardt Newsgroups: gmane.emacs.devel Subject: Re: rx.el sexp regexp syntax Date: Sat, 26 May 2018 01:32:11 +0200 Message-ID: <87fu2fgvlw.fsf@gmail.com> References: <87h8mw3yoc.fsf@gmail.com> <20180525155126.GA4096@ACM> <87lgc7hebk.fsf@gmail.com> <20180525181710.GC4096@ACM> <87k1rr78m2.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1527291064 26290 195.159.176.226 (25 May 2018 23:31:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 May 2018 23:31:04 +0000 (UTC) User-Agent: mu4e 1.0; emacs 26.1 Cc: rms@gnu.org, Noam Postavsky , emacs-devel@gnu.org, van@scratch.space, Alan Mackenzie , eliz@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 26 01:30:59 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 1fMMAk-0006gN-Af for ged-emacs-devel@m.gmane.org; Sat, 26 May 2018 01:30:58 +0200 Original-Received: from localhost ([::1]:47039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMMCr-0003i8-2J for ged-emacs-devel@m.gmane.org; Fri, 25 May 2018 19:33:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMMC5-0003hl-Kf for emacs-devel@gnu.org; Fri, 25 May 2018 19:32:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMMC4-0005bV-Mj for emacs-devel@gnu.org; Fri, 25 May 2018 19:32:21 -0400 Original-Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:34418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMMC0-0005Y1-Sj; Fri, 25 May 2018 19:32:17 -0400 Original-Received: by mail-wr0-x236.google.com with SMTP id j1-v6so11696545wrm.1; Fri, 25 May 2018 16:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:references:user-agent:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=OKvVC3gpUzdpBLXjC+kykghSd+D6HM8kILwkK9iAmBs=; b=rsXotC8NsbPLp3MwPVW6/a4nR8/XoSXG1UZwoAPGMHDSJ4OETzCmvsrMuR3+8drD64 MMAlkMcY6RaDdNn3/ExLSOVjFO2xvjKxajDwKVdMjIUDHr98UWnGLeMrq+MCKd0MWmjk /x9uWUPbCPa5OI6XbXzy68A4ZLNpL5sWNeqKWBIAI2aYMm5UNOOlZVQpVJcHDucdhh9x lXRpL52nP8TaFn/F9YTwsJ6X0vhQfgcyx+bFfX23u1tV8QYwdOK6tSQ4jFMJou67OElL bGNEfJou0ImHIA4qwpBZnxWctRnck7LiLLXgqxxbD7ppdt97qmfZA7G9KEUhOtevcwl0 RuHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:user-agent:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=OKvVC3gpUzdpBLXjC+kykghSd+D6HM8kILwkK9iAmBs=; b=Kkvvpc8JeJ066HrklqAYPx2vQcfrL8Lo+2av5zuvsrP32E3i0PHnggtvFLyh3MYv7s 8TFluCezhXZnGC0l92p8Jt9vUKeNtjhZOa6Uml/IW+9zLJlJ4sCwugpLrYEH0fSjmVwI PkZtgXUvSfgkvhpX/lUWV0jt6BWmZ0WqRhe7xWOlX1ueAG5l7Ju7N/hKCpVsy/n3ta1P L1tbLKaNdlITFqmVEAIbdimBhRIvbugbrsHaVBxnDWnM8WgSv5dSW+3HmgP5b5j+niOq ctRclCVIlSx0e7QPb5jTW4vvjX2YrCTLG4uTYiPK7AWjoosebQoLagU1LKM3gX9Z4bSU i22g== X-Gm-Message-State: ALKqPwdjxCj4DaRCibQFXyl+VJxIr31iyY2wvZmI4CtPbmy4rZ+QRd9t 0AvkOp5a2jIK9YAeeqitDHc= X-Google-Smtp-Source: AB8JxZokQuLSdmsWMjVJOhKPgrDPc/+bT9bF85HQnlx7Hn2wQ06XEURifDeZd4pv1OkwoIuByP3rLg== X-Received: by 2002:adf:8406:: with SMTP id 6-v6mr3687030wrf.105.1527291135497; Fri, 25 May 2018 16:32:15 -0700 (PDT) Original-Received: from mimimi (87-89-234-173.abo.bbox.fr. [87.89.234.173]) by smtp.gmail.com with ESMTPSA id 187-v6sm11096755wmu.41.2018.05.25.16.32.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 May 2018 16:32:14 -0700 (PDT) X-Google-Original-From: Peter Neidhardt In-reply-to: <87k1rr78m2.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::236 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:225735 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michael Heerdegen writes: >> A string regexp, by contrast, usually fits onto a single line. > > But regexps are tree-like structures. That's why rx, which uses sexps > (i.e. trees), is the easier to read representation for complicated > regexps than a one-dimensional string. Unless you have the ability to > form a representation in your head. I did not think of this at first but I think it's an excellent, fundamental point. >> The "English" counterpart used in rx is bulky and difficult to learn. >> Somehow, you've got to learn that it's "word-start" and not >> "word-beginning", that it's "not" and not "non", and so on. > > That's IMHO the main reason why people avoid using rx. I wonder if that > aspect of rx could be improved (why not just use $ as synonym for bol > etc.)? I guess you meant 'eol' ;) rx supports synonyms and I think in general it's not a good idea. That said, I really like that it uses meaningful words. So instead of =E2=80=98line-end=E2=80=99, =E2=80=98eol=E2=80=99 I'd leave it to only =E2=80=98line-end=E2=80=99 =2D-=20 Peter Neidhardt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlsInPsACgkQm9z0l6S7 zH94wAf7BuMPEbOWoVmr4cI3tHUB6bHsbqrUkyG9YWp1w07ch9x3DN3NdzJ+/uPQ ukzKMrKJeDSovQNA27j65msI/+GXyL7gtuqUj7wVwyNzQJhP27Gar1+nXsK4upuK mIseh+GlIHYzHStz7ZVoaw6g56WcA+ceKWS6AU8r/NvxRgc5YRYhipy/Mia3gCnu C7o7leAVodI/2DKYifF+kJHxXSwTvNvGZGPKrNr2KIjOT9u31kex4CM3CQuiDMD5 OJ/84tFPIeLlQfSOpVm0o+xhOp1tR4Msfxjqp/LMv2u3abGh957DlEUxhKJIn8k+ Umx//qEfdbdxRtxtLDqpVsVrlPOO1A== =YBX2 -----END PGP SIGNATURE----- --=-=-=--