From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15511 invoked from network); 26 Mar 2002 17:27:17 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Mar 2002 17:27:17 -0000 Received: (qmail 6067 invoked by alias); 26 Mar 2002 17:26:57 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4786 Received: (qmail 6055 invoked from network); 26 Mar 2002 17:26:55 -0000 From: "Bart Schaefer" Message-Id: <1020326172630.ZM32331@candle.brasslantern.com> Date: Tue, 26 Mar 2002 17:26:29 +0000 In-Reply-To: <20020326123144.GA24391@stu163.keble.ox.ac.uk> Comments: In reply to Ian Lynagh "Beginning of line matching" (Mar 26, 12:31pm) References: <20020326123144.GA24391@stu163.keble.ox.ac.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: Ian Lynagh , zsh-users@sunsite.dk Subject: Re: Beginning of line matching MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 26, 12:31pm, Ian Lynagh wrote: } } I would have expected ${FOO/(#s)/X} and ${${FOO/(#m)(#s)?/X$MATCH}:-X} } to be equivalent, but it seems that only the second one has the desired } effect when FOO is not empty. Is there a reason the first doesn't behave } as I expected? AFAICT, it's because "start of string" is considered to begin with the first real character, thus after the implicit intial empty substring. This should probably be considered a bug. Compare ${FOO/()/X}, and also ${FOO//()/X} ... -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net