Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: input foo, output '[F|f][O|o][O|o]'?
- X-seq: zsh-users 17845
- From: "TJ Luoma" <luomat@xxxxxxxxx>
- To: "Phil Pennock" <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- Subject: Re: input foo, output '[F|f][O|o][O|o]'?
- Date: Mon, 01 Jul 2013 20:24:13 -0400
- Cc: "Zsh-Users List" <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=smtpout; bh=TCdpp10t/uolF2hnM2MopG nK4qY=; b=O+t8QLv13lBnfcHlKKXcC2gwjA7NgyBbboAHQRUW1Cx0Pylk1AZwQc Nge3cexuXeniX5/RjAuYc6sT0zF2zd/8Vke7BYmATLUo3vkjIM7YxajBRX116Ffj wyxhIS+0FCOJadL0ozhMmlcwe/SB0gwKiy8VS+Zb5mpNtvET5SYQo=
- In-reply-to: <20130701193717.GA15681@redoubt.spodhuis.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <E2BB9B64-ECE8-4B69-BEEB-05B010699AB4@gmail.com> <20130701193717.GA15681@redoubt.spodhuis.org>
On 1 Jul 2013, at 15:37, Phil Pennock wrote:
> % foo=CrashPlan
> % for c in ${(s::)foo}; do print -n "[${(U)c}|${(L)c}]";done; print
> [C|c][R|r][A|a][S|s][H|h][P|p][L|l][A|a][N|n]
> %
That works great.
Thanks!
> If this is for use within zsh, then as ZyX suggests it's simpler, even
> for regexp cases:
>
> setopt rematch_pcre
> [[ "cRAShpLAn" =~ (?i)$foo ]]
It isn't… but that's helpful for future reference.
TjL
Messages sorted by:
Reverse Date,
Date,
Thread,
Author