mirror of https://github.com/dyne/zuper.git
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:
parent
5c978ec28a
commit
d8e9350523
4
zuper
4
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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue