From 967ff2f5cf9270a0ef01cb3a7a8f8d941ec2bcb6 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Sat, 1 Apr 2017 09:41:49 -0700 Subject: * 40782: avoid dependency on zsh/regex module --- Completion/Unix/Type/_hosts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/Unix/Type/_hosts b/Completion/Unix/Type/_hosts index 56540865e..d9e1090a4 100644 --- a/Completion/Unix/Type/_hosts +++ b/Completion/Unix/Type/_hosts @@ -50,12 +50,13 @@ if ! zstyle -a ":completion:${curcontext}:hosts" hosts _hosts; then # entries. () { local host + local -a match mbegin mend khosts=() for host; do if [[ $host == *[*?]* ]]; then continue - elif [[ $host =~ "\[(.*)\]:\d*" ]]; then - khosts+=$match + elif [[ $host = (#b)*\[(*)\]:[[:digit:]]#* ]]; then + khosts+=${match[1]} else khosts+=$host fi -- cgit 1.4.1