From mboxrd@z Thu Jan 1 00:00:00 1970
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org
X-Spam-Level:
X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,
RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no
version=3.4.4
Received: (qmail 10580 invoked from network); 5 Aug 2021 15:37:32 -0000
Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368)
by inbox.vuxu.org with ESMTPUTF8; 5 Aug 2021 15:37:32 -0000
ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1628177852;
b=bHPdt55akgHaZUs7KeqFUxZWFqgsIedSDxa989eHYapc9cZbP5KNPrWZdw8nS2HvP8z8I8cQL/
2nwxvoFzd4o6o1I3FfCZ7bSXMcV/w8STXshNnmVU55eqpz6hV/d51SKMQze2+qADQz7pGE4P5M
t5gTClqzA+tIQnm+yuGOIUt+6JZM2i9yHoK3Rn6uSrbVB4hLAWif4d3o8PePyQnNdokqzGoKpI
hi+3qXgiJzp+PKYxS3ec9j1xV5dTIg3e9IUeYvzzSUtDygedWfduS7g+3pGEyVVhoHELUaEMNs
kjxTodSzLwUymsHfKbnuarsJ3pGI/Ibz9krOhGQfPRhDiQ==;
ARC-Authentication-Results: i=1; zsh.org;
iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96;
dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256;
dmarc=pass header.from=ntlworld.com;
arc=none
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1628177852;
bh=j0tgZNunWBf7FrS480V19Ts3525DkG16myXUrQpdhz0=;
h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help:
List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:
References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature:
DKIM-Signature;
b=OOo7ZwaqErrwGc7OP5rGGNlN/s1oUYYrLOKcsuJ6wi7X3igX2HRBrRfi0FO5F7d7E2Y4oeF543
5ITxNNa6xWZ/V0brAjiRUBGLGO03TNrkt4MNcTcj2nixpzPn2OYdqFmdcSMRMgSdcV90rh0aJY
Xacte/VdUzzOnC0CJQMZ6xsXtIDBt+c25IIpZYj6hRSdYyVdclcXjMxIJSSDdGr8QDYZonZYis
/kPqh0PgnmVlAQBnF5mnUU+T+Egz4wncVFpENY1Ka0mAVq53TGjx7HDo/oWom5A0HzfvIuDsTC
g6Cl+DnS8cyyDUzBzvJYVnp9FayH2hOamoEJzv5v0u3Yxw==;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org;
s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:
List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding:
Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From:
Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID;
bh=HjNA+lc9DmfY7G/FlgT2WOc+d5AmFf2R0iuPA24aqmc=; b=eIQWj070bsu81t2wSD/Or3fKpP
puestB2sfCRj4hkegncr/u38ADfiWO5zGIvDv8ZsEZVJZ986jYxpoc/tRnFW9MA+e0Cd7Y+Cx9uZ0
sMfeNCWfwAigpE8NLClp+iFFCUH2CnZSbl/3eZ50XtTPYMUOCu/faAY+XN9gLSqAU/WbIXRw75O7k
QIWTBBMHC8Jf5OQVOmZ4hIcWQYGue9iFMzF3RgYrXVbP+B7hDlY0/VwwV0YhX0r2RTGn6yKvnuHWB
25jKMpM2EcTexAgRJV5OI5iOGOWnLj6N7fl7hGY1uRfbyF+obtXJJ+R+sT0bC4ghGTsSi585OH2aH
6pYCVBcw==;
Received: from authenticated user by zero.zsh.org with local
id 1mBfR5-0000hj-TN; Thu, 05 Aug 2021 15:37:31 +0000
Authentication-Results: zsh.org;
iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96;
dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256;
dmarc=pass header.from=ntlworld.com;
arc=none
Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:46876)
by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
id 1mBfQO-000PyB-Vo; Thu, 05 Aug 2021 15:36:49 +0000
Received: from [212.54.57.81] (helo=smtp2.tb.ukmail.iss.as9143.net)
by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.86_2)
(envelope-from
)
id 1mBfQO-0004Ye-T8
for zsh-users@zsh.org; Thu, 05 Aug 2021 17:36:48 +0200
Received: from oxbe8.tb.ukmail.iss.as9143.net ([172.25.160.139])
by smtp2.tb.ukmail.iss.as9143.net with ESMTP
id BfQOmHnvkZ49GBfQOm0kaT; Thu, 05 Aug 2021 17:36:48 +0200
X-Env-Mailfrom: p.w.stephenson@ntlworld.com
X-Env-Rcptto: zsh-users@zsh.org
X-SourceIP: 172.25.160.139
X-CNFS-Analysis: v=2.4 cv=XZHqcK15 c=1 sm=1 tr=0 ts=610c0590 cx=a_exe
a=pgSR3NrKiwmx/6vnWRL19w==:117 a=sfM75MaK4YAA:10 a=IkcTkHD0fZMA:10
a=2y5beTJ5bSgA:10 a=NLZqzBF-AAAA:8 a=gir0-LH0AAAA:8 a=BUCEY1w2GY50bxLhuKEA:9
a=QEXdDO2ut3YA:10 a=wW_WBVUImv98JQXhvVPZ:22 a=aLewGyoHDmJ4ULJHWpSz:22
X-Authenticated-Sender: p.w.stephenson@ntlworld.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com;
s=meg.feb2017; t=1628177808;
bh=j0tgZNunWBf7FrS480V19Ts3525DkG16myXUrQpdhz0=;
h=Date:From:To:In-Reply-To:References:Subject;
b=yI+1dB5DO0/sl5TOAQPrd1YecEgI3uc4+l0qqeVm6wYqTqzQK3wtRQzxWBXrCHTBu
AeS3u+95mtLGvGnZ9teIIb7y8UMQAJZprvKkIEjc/rrnB3mYAX0W1VKTnlm85Ivi3s
rFRwRqPZGN5sdUAd4ohEHISWZf1HOTJR5WMO2Ysw48aZJfqVLquloZpbk8zaKCF2CF
t9Qkza7tg477UtfpxCqiE/9d/FXxtuzYz+PRoaVgzQRwA3XogZQ8AOWqH+L/dU4kny
I9i7d95rAn6KX6d/atVNj1Bxy/wCXw6IWUU3GewVe8jS42GR6vhwJOg4t8iJZieCzD
FS8ruwMDR0qLA==
Date: Thu, 5 Aug 2021 16:36:48 +0100 (BST)
From: Peter Stephenson
To: Zsh Users
Message-ID: <600156803.688994.1628177808803@mail2.virginmedia.com>
In-Reply-To: <112137895.688578.1628177238255@mail2.virginmedia.com>
References: <5bd2624d-86f4-fc9f-f57a-1e3b93a5fefb@eastlink.ca>
<112137895.688578.1628177238255@mail2.virginmedia.com>
Subject: Re: file globbing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
Importance: Medium
X-Mailer: Open-Xchange Mailer v7.8.4-Rev72
X-Originating-IP: 165.225.81.118
X-Originating-Client: open-xchange-appsuite
X-CMAE-Envelope: MS4xfJmMjLCd1rQvuBiH6ya1YJ6YMDS93VXJ8uslJ8baEW5yhHJk+BC953uBxUl0z95k76hZI3LqYCXRVXRlpOAF7OW4gUKcZzkdvyZiS0aUjg/VXvQeWZBA
9TqG1zYnqwJcBbCVbiauac5D7vFmI27/NXEaJpL5d2tgX1eZvhntWukQSFPMByUNJZAYbnFcPpT9ZaB7sSvHA/sbHM594IOen/Tx6lOuaMEfWBv37z8JwzEy
X-Seq: 26864
Archived-At:
X-Loop: zsh-users@zsh.org
Errors-To: zsh-users-owner@zsh.org
Precedence: list
Precedence: bulk
Sender: zsh-users-request@zsh.org
X-no-archive: yes
List-Id:
List-Help:
List-Subscribe:
List-Unsubscribe:
List-Post:
List-Owner:
List-Archive:
> On 05 August 2021 at 16:27 Peter Stephenson =
wrote:
> > On 05 August 2021 at 16:14 Ray Andrews wrote:
> > Say I have these files:
> >=20
> > =C2=A0=C2=A0=C2=A0=C2=A0 0 [2021-08-05--07:58] d,1
> > =C2=A0=C2=A0=C2=A0=C2=A0 0 [2021-08-05--07:59] d,1,first
> > =C2=A0=C2=A0=C2=A0=C2=A0 0 [2021-08-05--07:59] d,1,second
> >=20
> > I want a glob that captures them all but:
> >=20
> > =C2=A0=C2=A0=C2=A0 $ print -l d,1[^[:digit:]]*(N)
> > =C2=A0=C2=A0=C2=A0 d,1,first
> > =C2=A0=C2=A0=C2=A0 d,1,second
>=20
> Yes, indeed it looks like this is available by default (you don't even ne=
ed EXTENDED_GLOB).
>=20
> d,1([^[:digit:]]*|)(N)
>=20
> The (either_this|or_that) matches either what you originally said or noth=
ing ("or_that" here is empty).
>=20
> There are other ways of doing it, and there's a ksh/bash-compatible way, =
too, but that's probably
> the one I'd immediately reach for.
Actually, come to think of it, I can't resist mention one other one, since =
it keeps the squiggles
to a bare minimum, though this *does* require "setopt extendedglob".
d,1^[[:digit:]]*
That means "d,1" following by anything that doesn't match the pattern after=
the "^". Caution
needs to be exercised with more complicated uses of "^", though --- negativ=
e match assertions
can be really counterintuitive.
pws