From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1862 invoked from network); 4 Aug 2003 15:53:38 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Aug 2003 15:53:38 -0000 Received: (qmail 6898 invoked by alias); 4 Aug 2003 15:53:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6439 Received: (qmail 6881 invoked from network); 4 Aug 2003 15:53:24 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 4 Aug 2003 15:53:24 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.233.107] by sunsite.dk (MessageWall 1.0.8) with SMTP; 4 Aug 2003 15:53:23 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h74FrLY16201 for zsh-users@sunsite.dk; Mon, 4 Aug 2003 08:53:21 -0700 From: Bart Schaefer Message-Id: <1030804155321.ZM16200@candle.brasslantern.com> Date: Mon, 4 Aug 2003 15:53:21 +0000 In-Reply-To: <20030804153810.GA17793@spiegl.de> Comments: In reply to Andy Spiegl "Re: something simple (I hope)" (Aug 4, 5:38pm) References: <20030804143351.GA14857@spiegl.de> <20030804151216.GB25043@picard.franken.de> <20030804153810.GA17793@spiegl.de> X-Mailer: Z-Mail (5.0.0 30July97) To: ZSH User List Subject: Re: something simple (I hope) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 4, 5:38pm, Andy Spiegl wrote: } Subject: Re: something simple (I hope) } } > > I want to put all files that match the regex pattern } > > "^/var/tmp/exec\.[0-9]+$" } > > into a list that I can then use in a foreach loop. } } Actually in the meantime I found out how to do that: } files=(/var/tmp/exec.[[:digit:]]*) } } But what is still bugging me is that this also matches files like } /var/tmp/exec.01234.something } } I can't figure out how to tell zsh that there shouldn't be anything _after_ } digits. What is the zsh-equivalent of a $ in regular expressions? All glob patterns are implicitly anchored at start and end; there's no such thing as a file glob that matches anywhere in a file name. What you've forgotten is that * in a glob pattern is equivalent to .* in a regular expression. It's # in zsh that repeats the preceeding glob pattern. So what you want is setopt extendedglob files=( /var/tmp/exec.[[:digit:]]# )