From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20557 invoked from network); 10 Dec 2003 13:03:44 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Dec 2003 13:03:44 -0000 Received: (qmail 2088 invoked by alias); 10 Dec 2003 13:03:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6858 Received: (qmail 2039 invoked from network); 10 Dec 2003 13:03:17 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 10 Dec 2003 13:03:17 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 10 Dec 2003 13:3:17 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Wed, 10 Dec 2003 13:03:09 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 10 Dec 2003 13:04:45 +0000 To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: regexing to remove punctutation in telephone numbers In-reply-to: "Eric Smith"'s message of "Wed, 10 Dec 2003 13:46:17 +0100." <20031210124617.GA3027@fruitcom.com> Date: Wed, 10 Dec 2003 13:03:13 +0000 Message-ID: <7336.1071061393@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 10 Dec 2003 13:04:45.0172 (UTC) FILETIME=[2ECE9340:01C3BF1E] Eric Smith wrote: > Could someone suggest a neat zsh way to convert > > $ myfax 00-(123) 4567-890 _some_file_name_ AnotherFileName.ps whatever > > to > > 001234567890 _some_file_name_ AnotherFileName.ps whatever I don't know how flexible you want to be, but: myfax () { command myfax "${1//[-()]}${2//[-()]}" ${argv[3,-1]} } removes the offending characters from the first two arguments and joins them together. 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. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************