Checks if the string is a well formed email address..

@param string $string
@return boolean
177233
public static function isEmail($email) {
        if (!is_string($email) || strlen($email) > 255)
            return false;
        if (Tools::phpVersionCompareTo('5.3.3') >= 0)
            return (boolean) filter_var($email, FILTER_VALIDATE_EMAIL);
        else
            return (boolean) preg_match('`^(?!\.)[.\w!#$%&\'*+/=?^_\`{|}~-]+@(?!-)[\w-]+\.\w+$`i', $email);
    }
739371
public static function isApplicable($string)
    {
        $firstline = strtok($string, "\r\n\t");

        return strpos($firstline, ':20:AI') !== false && strlen($firstline) === 20;
    }
34852
public static function stringToBoolean($string)
    {
        $flag = filter_var($string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);

        if ($flag) {
            return true;
        } elseif (is_null($flag)) {
            return $string;
        }

        return false;
    }
1298613
public static function isSingular($string)
    {
        // Check cache assuming the string is plural.
        $singular = isset(self::$_cache['singularized'][$string]) ? self::$_cache['singularized'][$string] : null;
        $plural = $singular && isset(self::$_cache['pluralized'][$singular]) ? self::$_cache['pluralized'][$singular] : null;
        
        if ($singular && $plural) {
            return $plural != $string;
        }
        
        // If string is not in the cache, try to pluralize and singularize it.
        return self::singularize(self::pluralize($string)) == $string;
    }
1010020
def is_email_address(string):
    
    return string and isinstance(string, base_string) \
        and REGEX_PATTERN_EMAIL_ADDRESS.match(string.strip().lower())
74471
public static function validateTrimmed($string)
    {
        if (SetupHelper::trim($string) === $string) {
            return (string)$string;
        }

        throw new InvalidArgumentException(
            sprintf(
                'Provided string "%1$s" was not trimmed.',
                $string
            )
        );
    }
1281088
public function valid_email($str)
    {
        if (function_exists('filter_var')) {

            return (bool) filter_var($str, FILTER_VALIDATE_EMAIL);

        } else {

            return parent::valid_email($str);
        }
    }
610477
public static function validateEmail($string)
    {
        if (filter_var($string, FILTER_VALIDATE_EMAIL)) {
            return (string)$string;
        }

        throw new InvalidArgumentException(
            sprintf(
                'Provided string "%1$s" was not a valid email.',
                $string
            )
        );
    }
243908
public static function isPair($string)
    {
        $pair = explode("\x20", $string);

        if (count($pair) == 2) {
            if (self::isIdentifier(self::toLowerTrim($pair[0])) && self::isIdentifier(self::toLowerTrim($pair[1]))) {
                return true;
            }
        }

        return false;
    }
200853
private function isValidText($string)
    {
        $search = array(" ", "　", "\n", "\r", "\t");
        $replace = array("", "", "", "", "");
        return str_replace($search, $replace, $string) !== '';
    }
803716
public static function email(string $value): bool
    {
        $result = filter_var($value, FILTER_VALIDATE_EMAIL);
        return is_string($result) && $value === $result;
    }
354682
public static function email($email)
    {
        $email = Str::trim($email);
        $cleaned = filter_var($email, FILTER_VALIDATE_EMAIL);

        if (Email::isValid($cleaned)) {
            return $cleaned;
        }

        return false;
    }
1260433
public function isEmailUnique($email)
    {
        $this->find("email", $email);
        if (isset($this->id)) {
            return false;
        }
        return true;
    }
1344241
protected function stringToBoolean($string)
    {
        $string = is_string($string) ? strtolower($string) : $string;

        if (in_array($string, array(true, 1, '1', 'yes', 'true'), true)) {
            return true;
        }

        return false;
    }
1094665
def is_email(string):
    
    email_regex = r'^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$'

    if isinstance(string, str) and not re.match(email_regex, string):
        return False
    else:
        return True
1282961
private function hasAttachedMethod($string)
    {
        return 1 === substr_count($string, self::M_SEPARATOR) && 0 !== strpos($string, self::M_SEPARATOR);
    }
898772
public static function isEmail($email)
    {
        $pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
        if (is_string($email) && preg_match($pattern, $email)) {
            return true;
        }

        return false;
    }