From: Sebastian Gniazdowski <psprint3@fastmail.com>
To: zsh-workers@zsh.org
Subject: Re: PATCH: Don't use =~ for simple prefix match
Date: Mon, 06 Mar 2017 23:01:18 -0800 [thread overview]
Message-ID: <1488870078.4134663.902885016.01CB6E2F@webmail.messagingengine.com> (raw)
In-Reply-To: <1488869415.4132903.902877024.7D41352B@webmail.messagingengine.com>
One thing, (#b) needs extendedglob, not sure if completion provides it.
However the code was already in anonymous function, so "setopt
localoptions extendedglob" can be easily added.
--
Sebastian Gniazdowski
psprint3@fastmail.com
On Mon, Mar 6, 2017, at 10:50 PM, Sebastian Gniazdowski wrote:
> Did similar for _hosts:
>
> - elif [[ $host =~ "\[(.*)\]:\d*" ]]; then
> - khosts+=$match
> + elif [[ $host = (#b)*\[(*)\]:[[:digit:]]#* ]]; then
> + khosts+=${match[1]}
>
> Also localized match parameters.
>
> Had to add wrapping stars because =~ matches substrings.
next prev parent reply other threads:[~2017-03-07 7:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 2:18 Mikael Magnusson
2017-03-07 6:50 ` Sebastian Gniazdowski
2017-03-07 7:01 ` Sebastian Gniazdowski [this message]
2017-03-07 9:33 ` Peter Stephenson
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=1488870078.4134663.902885016.01CB6E2F@webmail.messagingengine.com \
--to=psprint3@fastmail.com \
--cc=zsh-workers@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).