Browse Source

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

in a comment the alternate formula to do the same spawning grep
Jaromil 2 years ago
parent
commit
d8e9350523
1 changed files with 2 additions and 2 deletions
  1. 2 2
      zuper

+ 2 - 2
zuper

@@ -411,8 +411,8 @@ function string.extract_emails extract_emails() {
411 411
 
412 412
 # takes a string as argument, returns success if is an email
413 413
 function string.isemail isemail() {
414
-    [[ "$1" -regex-match "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ]] && return 0
415
-
414
+    [[ "$1" =~ "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ]] && return 0
415
+	# print "$1" | grep -q -E '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}' && return 0
416 416
     return 1
417 417
 }
418 418