From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26638 invoked by alias); 15 May 2014 17:16:44 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18825 Received: (qmail 13671 invoked from network); 15 May 2014 17:16:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140515101627.ZM30581@torch.brasslantern.com> Date: Thu, 15 May 2014 10:16:27 -0700 In-reply-to: <20140515163745.GJ1629@isis.sigpipe.cz> Comments: In reply to Roman Neuhauser "Re: ${name/pattern/repl} with negated pattern" (May 15, 6:37pm) References: <20140515122641.GI1629@isis.sigpipe.cz> <140515084550.ZM30494@torch.brasslantern.com> <20140515163745.GJ1629@isis.sigpipe.cz> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: ${name/pattern/repl} with negated pattern MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On May 15, 6:37pm, Roman Neuhauser wrote: } } ${name/pattern/repl} } ${name//pattern/repl} } [...] } The pattern may begin with a `#', in which case the pattern must } match at the start of the string, or `%', in which case it must } match at the end of the string, or `#%' in which case the pattern } must match the entire string. Indeed, I'd forgotten about that. Still: torch% setopt extendedglob torch% torch% echo #foo zsh: bad pattern: #foo torch% print ${a:##foo} torch% Evidently the syntax allowing the pattern to begin with a "#" is applied in the name:# case as well as in the name/ case, even though it should be meaningless for :#.