From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19765 invoked from network); 21 Mar 2001 16:03:25 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Mar 2001 16:03:25 -0000 Received: (qmail 3042 invoked by alias); 21 Mar 2001 16:02:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13690 Received: (qmail 3022 invoked from network); 21 Mar 2001 16:02:57 -0000 Message-ID: To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: non-greedy matching? In-Reply-To: Your message of "Wed, 21 Mar 2001 15:52:39 GMT." Date: Wed, 21 Mar 2001 16:02:31 +0000 From: Peter Stephenson > % foo='%{one%}hello%{two%}' > % print ${(S)foo//[%]\{*[%]\}} > hello > > Don't ask me why you need to put the `%' in square brackets --- there may > be some stray (s)printf in the code, for example. (Do tell me if you know > what it is.) I just realised: //% means match only at the end. % print ${(S)foo//\\%\{*[%]\}} also works. I always loathed that syntax: it's unmemorable and hacky (all right, it's not on its own). -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070