zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Matching delimiters for the "e" glob qualifier (Was: [Feature Request] Adding option to support triple quotes)
Date: Sun, 18 Aug 2019 19:58:17 +0100	[thread overview]
Message-ID: <20190818185817.55qgvidggem6hamh@chaz.gmail.com> (raw)
In-Reply-To: <CAHYJk3RAKmxRqZ4CRBEZBAco4017CMwm+Hbw4co-z2v1V2OK=Q@mail.gmail.com>

2019-08-18 06:24:32 +0200, Mikael Magnusson:
> On 8/17/19, Stephane Chazelas <stephane.chazelas@gmail.com> wrote:
> >
> > On a related note, I really wish the glob*(e'(code $(...))')
> > worked, as in the code that looks for the closing ) for the e
> > glob qualifier would find the matching ")" as opposed to the
> > first one (same in the s/j... parameter expansion flags, etc.)
> 
> You probably want glob*(e*'code $(...)'*), an unquoted * will never
> match a quoted *, eg:
> % echo .(e*'touch \*hi; reply=("*"*)'*)
> *hi
[...]

Thanks,

I'm not sure why it works of why it doesn't work with other
characters (it seems to work with ? as well though), but I can
confirm it does and it's very handy indeed.

Are we guaranteed it will stay that way?

I've just realised we can also do:

echo .(e'
 single-line code
')

BTW, this doesn't look right:

$ (echo a(eé'echo é'é)) |& sed -n l
zsh: unknown file attribute: ^\003$

-- 
Stephane

  reply	other threads:[~2019-08-18 18:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2c845fb0-d628-400f-a805-ad8356b6d87a@www.fastmail.com>
     [not found] ` <7EBD1ADA-7179-4EEF-97CA-DBE4371D80D6@icloud.com>
     [not found]   ` <876f807b-dfdd-4246-8cfe-7cf6f373ac88@www.fastmail.com>
     [not found]     ` <f053e72e-e22e-4729-a2de-eaa712119728@www.fastmail.com>
2019-08-15 16:23       ` [Feature Request] Adding option to support triple quotes Aryn Starr
2019-08-17  5:31         ` Bart Schaefer
2019-08-17  6:30           ` Stephane Chazelas
2019-08-17  8:19             ` Stephane Chazelas
2019-08-18  4:24             ` Mikael Magnusson
2019-08-18 18:58               ` Stephane Chazelas [this message]
2019-08-18 19:55                 ` Matching delimiters for the "e" glob qualifier (Was: [Feature Request] Adding option to support triple quotes) Bart Schaefer
2019-08-19  6:46                   ` Matching delimiters for the "e" glob qualifier Stephane Chazelas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190818185817.55qgvidggem6hamh@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).