From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1710 invoked from network); 17 May 2005 13:00:44 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 May 2005 13:00:44 -0000 Received: (qmail 72604 invoked from network); 17 May 2005 13:00:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 May 2005 13:00:38 -0000 Received: (qmail 562 invoked by alias); 17 May 2005 13:00:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8845 Received: (qmail 545 invoked from network); 17 May 2005 13:00:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 May 2005 13:00:29 -0000 Received: (qmail 71492 invoked from network); 17 May 2005 13:00:29 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 17 May 2005 13:00:18 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Tue, 17 May 2005 13:58:31 +0100 Received: from csr.com ([10.102.144.127]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 17 May 2005 14:01:40 +0100 To: zsh-users@sunsite.dk Subject: Re: echo $fred:s/str1/str2/ In-Reply-To: Message from zzapper of "Tue, 17 May 2005 13:31:09 BST." <7poj81po8fr55i9k6h6as8s6uco3jnre9c@4ax.com> References: <7poj81po8fr55i9k6h6as8s6uco3jnre9c@4ax.com> Date: Tue, 17 May 2005 14:00:18 +0100 Message-ID: <27161.1116334818@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 17 May 2005 13:01:40.0353 (UTC) FILETIME=[911A6F10:01C55AE0] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 zzapper wrote: > echo $fred:s/bu/hhh/ > > I don't seem to be able to use regexp's in the substitute tho' it's suggested > that it's possible in > the doc You can't use patterns with that form, which is the history modifier syntax. You can use patterns with this form: echo ${fred/bu/hhh} A useful trick with this form if you need to manipulate the matched part is to use the (#m) extended globbing flag and the $MATCH variable: % fred="hello harry" % print ${fred//(#m)[aeiou]/${(U)MATCH}} hEllO hArry pws ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************