From d8e9350523ae0e8ad903a3a85bccc8afc97cda31 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Wed, 29 Nov 2017 20:57:01 +0100 Subject: [PATCH] remove -regex-match for =~ as zsh ditched the former in a comment the alternate formula to do the same spawning grep --- zuper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zuper b/zuper index bd6c6a8..2aafbd7 100755 --- a/zuper +++ b/zuper @@ -411,8 +411,8 @@ function string.extract_emails extract_emails() { # takes a string as argument, returns success if is an email function string.isemail isemail() { - [[ "$1" -regex-match "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ]] && return 0 - + [[ "$1" =~ "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ]] && return 0 + # print "$1" | grep -q -E '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}' && return 0 return 1 }