From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: ksX-Mailer: MH-E 8.6; GNU Mailutils 3.2; GNU Emacs 24.5.1
Date: Sat, 9 Sep 2017 22:08:11 -0700 [thread overview]
Message-ID: <170909220811.ZM25125@torch.brasslantern.com> (raw)
In-Reply-To: <20170910015141.GA12309@tower.spodhuis.org>
On Sep 9, 9:51pm, Phil Pennock wrote:
}
} On 2017-09-09 at 17:00 +1700, jdh wrote:
} > Is this a a feature or a bug?
}
} Both, I think?
Well, not exactly.
} It's because those are pattern characters, thus the `*` matching the
} first item and returning `1`. So I'd _expect_ that using the `e` flag
} too would resolve it, but it only fixes two of those.
Hrm. The doc explicitly says:
... To match the value
of a parameter literally in a reverse subscript, rather than as a
pattern, use `${(q)NAME}' (*Note Parameter Expansion::) to quote the
expanded value.
However: All that the (e) flag actually does is untokenize() the
string that was previously tokenized for the (i) flag. The string
is still thereafter passed through patcompile() and matched as a
pattern against the value.
Interestingly,
torch% print $chrtab[(i)#]
1
torch% print $chrtab[(ie)#]
5
I don't know why a pattern consisting of an UNtokenized "#" compiles
into something that _doesn't_ match a literal "#".
prev parent reply other threads:[~2017-09-10 5:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-09 0:00 jdh
2017-09-10 1:51 ` Phil Pennock
2017-09-10 5:08 ` Bart Schaefer [this message]
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=170909220811.ZM25125@torch.brasslantern.com \
--to=schaefer@brasslantern.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).