From: "Jérémie Roquet" <arkanosis@gmail.com>
To: reckoner <reckoner@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: how to use character range [] in substitution pattern :gs
Date: Wed, 9 May 2012 16:23:20 +0200 [thread overview]
Message-ID: <CAFOazAPy7N_YGSoSekMcqDM_bbJjDj51ObT_Er9Ue=Jqj-KPEg@mail.gmail.com> (raw)
In-Reply-To: <4FAA78BD.3020602@gmail.com>
Hi,
2012/5/9 reckoner <reckoner@gmail.com>:
> I'm trying to use the the [] character range to substitute for embedded
> parenthesis as in the following:
>
> % echo ${x:gs/[()]/_/}
>
> But This isn't working for some reason. It's not complaining about syntax,
> so I'm pretty sure that I'm using the character range [] incorrectly
> somehow.
By default, the left side of a substitution is a string, not a
pattern. You have to setopt HIST_SUBST_PATTERN to use patterns
instead.
Best regards,
--
Jérémie
next prev parent reply other threads:[~2012-05-09 14:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 14:01 reckoner
2012-05-09 14:23 ` Jérémie Roquet [this message]
2012-05-09 14:38 ` Peter Stephenson
2012-05-09 16:00 ` reckoner
2012-05-09 16:34 ` Peter Stephenson
2012-05-09 17:12 ` reckoner
2012-05-09 17:25 ` Re[2]: " Vadim Zeitlin
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='CAFOazAPy7N_YGSoSekMcqDM_bbJjDj51ObT_Er9Ue=Jqj-KPEg@mail.gmail.com' \
--to=arkanosis@gmail.com \
--cc=reckoner@gmail.com \
--cc=zsh-users@zsh.org \
/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).