zsh-users
 help / color / mirror / code / Atom feed
From: Eric Smith <es@fruitcom.com>
To: Zsh users list <zsh-users@sunsite.dk>
Subject: Re: regexing to remove punctutation in telephone numbers
Date: Wed, 10 Dec 2003 14:17:56 +0100	[thread overview]
Message-ID: <20031210131756.GA29126@fruitcom.com> (raw)
In-Reply-To: <7336.1071061393@csr.com>

Peter Stephenson said:
> 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:

Thanks Peter,

Thats exactly the point ...

> 
> myfax () {
>         command myfax "${1//[-()]}${2//[-()]}" ${argv[3,-1]}
> }

There can be n number of args with the offending punctutation characters.  
And n should be determined from the first arg that commences in a non
[-()0-9] character.

-- 
Eric Smith


  reply	other threads:[~2003-12-10 13:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-01 11:17 avoid file not found error with { .. } expansion Eric Smith
2003-12-01 12:02 ` Peter Stephenson
2003-12-10 12:46   ` regexing to remove punctutation in telephone numbers Eric Smith
2003-12-10 13:03     ` Peter Stephenson
2003-12-10 13:17       ` Eric Smith [this message]
2003-12-10 13:44         ` Oliver Kiddle
2003-12-01 12:07 ` avoid file not found error with { .. } expansion Thomas Köhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031210131756.GA29126@fruitcom.com \
    --to=es@fruitcom.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).