#
# Check whether string seems like an email
@IsEmail[email]
$result(^if(def $email && ^email.match[^^\w+([.-]?\w+)+\@\w+([.-]?[^^@]\w+)*\.[a-z]{2,4}^$][i]){1}{0})
#/IsEmail
And example of use:
^if(!^IsEmail[user@aol.com]){Invalid email}
#
# Check whether string seems like an email
@IsEmail[email]
$result(^if(def $email && ^email.match[^^\w+([.-]?\w+)+\@\w+([.-]?[^^@]\w+)*\.[a-z]{2,4}^$][i]){1}{0})
#/IsEmail
^if(!^IsEmail[user@aol.com]){Invalid email}
No comments:
Post a Comment