remove -regex-match for =~ as zsh ditched the former

in a comment the alternate formula to do the same spawning grep
This commit is contained in:
Jaromil 2017-11-29 20:57:01 +01:00
parent 5c978ec28a
commit d8e9350523
1 changed files with 2 additions and 2 deletions

4
zuper
View File

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