Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Don't use =~ for simple prefix match



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@xxxxxxxxxxxx

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.



Messages sorted by: Reverse Date, Date, Thread, Author