I took the second expression from the first link, added separators and "case insensitive" flag, and set it into a custom identifier:
alias ismail {
var %r = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
if ($regex($1,%r)) { return $true }
return $false
}
Now try
//echo -a $ismail(test) $ismail(@nothing) $ismail(123@456) $ismail(nick!ident@host.domain) $ismail(Test@something.com)
And use $ismail(<address>), like in
alias mailtest {
if ($ismail($input(Enter eMail address:,eog,Mail Address))) { echo -a valid address given: $! }
else { echo -a no/invalid address given }
}