From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9934 invoked from network); 14 Apr 2000 13:04:29 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Apr 2000 13:04:29 -0000 Received: (qmail 8915 invoked by alias); 14 Apr 2000 13:04:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10761 Received: (qmail 8903 invoked from network); 14 Apr 2000 13:04:16 -0000 Date: Fri, 14 Apr 2000 14:03:45 +0100 From: Peter Stephenson Subject: Re: PATCH: fix for (#s) and (#e) in param substs In-reply-to: "Your message of Fri, 14 Apr 2000 13:00:58 BST." To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FT000MQQCA8D3@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT > Peter Stephenson wrote: > >By the way, I inserted a hostage to fortune in the manual by claiming that > >`(^(#s))' etc. also work, i.e. you can assert that you are not at the start > >of the string. > > Careful. If that's been implemented correctly, `(^(#s))' will match > an arbitrarily long substring anywhere, in addition to a zero-length > substring anywhere other than the start of the string. Yes, this was at the back of my mind but I didn't really work it all out. (''~(#s)) works, though is a bit clumsy. Index: Doc/Zsh/expn.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v retrieving revision 1.5 diff -u -r1.5 expn.yo --- Doc/Zsh/expn.yo 2000/04/14 11:49:31 1.5 +++ Doc/Zsh/expn.yo 2000/04/14 13:01:06 @@ -1318,7 +1318,10 @@ provides a single simple and memorable method. Note that assertions of the form `tt((^(#s)))' also work, i.e. match -anywhere except at the start of the string. +anywhere except at the start of the string, although this actually means +`anything except a zero-length portion at the start of the string'; you +need to use `tt((""~(#s)))' to match a zero-length portion of the string +not at the start. ) enditem() -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070