Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Matching delimiters for the "e" glob qualifier (Was: [Feature Request] Adding option to support triple quotes)
- X-seq: zsh-workers 44683
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- 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
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=1yScMTMX1CA3JNQUp84cXZ4/1IjE2FYn7cisucdwqxg=; b=jfiFAuUxpaEBgOMjWnPfClmZq6tiRjr+JqbNna2rb3FyCIKv6B+IUcEv5BERAiDuCV 4qDVML4WjVc4KM7TQmpMBVuCOH3lJU1Hxf+UwPJhkTpqvRACaLjCD7DMAnzzmKbz6Sp7 Vf8lggoywQUki2viTwBJH7Mvu7sutDnf1jp6ABz0OuuQLQ4rXArsGeTuWDrTVeZRn8x6 0zM0p5tvcWEfTiWEU14htUJOFLwKPsBPjnr+kxbjtrbfDj8mAk9RqFf/sHU0B1i48Onv FsTQ8N4YPOG/Mm+JO/b4jG6yVy5vA1DjRyVXhzeVNsW95SG4JzJ6fUd1RSRZHDIlUBJ1 IVvQ==
- In-reply-to: <CAHYJk3RAKmxRqZ4CRBEZBAco4017CMwm+Hbw4co-z2v1V2OK=Q@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <2c845fb0-d628-400f-a805-ad8356b6d87a@www.fastmail.com> <7EBD1ADA-7179-4EEF-97CA-DBE4371D80D6@icloud.com> <876f807b-dfdd-4246-8cfe-7cf6f373ac88@www.fastmail.com> <f053e72e-e22e-4729-a2de-eaa712119728@www.fastmail.com> <AAFFC725-E38F-4307-8E21-8A443FC0FFBC@icloud.com> <CAH+w=7bh3d950w_kT8KN5MeDjagapuoSqbWRBmFo8S=ZTUnwvg@mail.gmail.com> <20190817063009.7niz4cz2tuqx3ksu@chaz.gmail.com> <CAHYJk3RAKmxRqZ4CRBEZBAco4017CMwm+Hbw4co-z2v1V2OK=Q@mail.gmail.com>
2019-08-18 06:24:32 +0200, Mikael Magnusson:
> On 8/17/19, Stephane Chazelas <stephane.chazelas@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author