Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
backreferences
- X-seq: zsh-users 20761
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: backreferences
- Date: Thu, 15 Oct 2015 11:28:09 -0700
- 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
I'm not sure if this is even a good question:
test2 ()
{
sstring="before inside after"
if [[ "$sstring" = (#b)([^i]#inside)(*) ]];
then
echo "\n\ndo nothing\n\n"
fi
echo one $match[1]
echo two $match[2]
}
... all good. But is is possible to populate 'match'
without the 'if' test? Point being that I don't really
want to 'do anything' except populate 'match'. There's
no problem, I'm just wondering if it can be expressed
more simply and I'll bet it can.
Better question:
In this construction " [^i] " is it possible to use a
string rather than a character in the exclusion test?
I've found convoluted ways to do it, but is there anything
simple?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author