Match all email addresses

@param string $str
@return boolean|array
486979
public static function emails(string $str) {
		preg_match_all(self::REGEXP_EMAIL, $str, $matches);
		return $matches[0] ?? false;
	}
752980
public function HasMultiBytes($str) {
    if (function_exists('mb_strlen')) {
      return (strlen($str) > mb_strlen($str, $this->CharSet));
    } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
      return false;
    }
  }
431416
static private function ContainsSpace( 
                            string $str
    ) : bool {		
    
        $ret = false;
    
        for ( $i = 0; $i < strlen( $str ); $i++ ) {
            if ( ctype_space( substr( $str, $i, 1 ) ) ) {
                $ret = true;
                break;
            }
        }
        
        return $ret;
    
    }
1317951
protected function isRegex($str)
    {
        if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
            $start = substr($m[1], 0, 1);
            $end = substr($m[1], -1);

            if ($start === $end) {
                return !preg_match('/[*?[:alnum:] \\\\]/', $start);
            }

            foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) {
                if ($start === $delimiters[0] && $end === $delimiters[1]) {
                    return true;
                }
            }
        }

        return false;
    }
190363
public function hasMultiBytes($str)
    {
        if (function_exists('mb_strlen')) {
            return (strlen($str) > mb_strlen($str, $this->CharSet));
        } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
            return false;
        }
    }
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);
        }
    }
1270556
protected function match(array &$str, $pattern, $keep)
    {
        $tokens = array();
        foreach ($str as $s) {
            preg_match_all($pattern, $s, $m);
            $tokens = array_merge(
                $tokens,
                $m[$keep]
            );
        }

        $str = $tokens;
    }
842310
public static function multiScheduleSelectTime($str)
    {
        $arr = explode(';', $str);

        $ret = [];
        foreach ($arr as $item) {
            if ($result = static::scheduleSelectTime($item)) {
                $ret[] = $result;
            }
        }

        return $ret;
    }
419353
public function filterTrace($str)
    {

        if (empty($this->options['backtrace_filters']) || !is_array($this->options['backtrace_filters'])) {
            return $str;
        }

        foreach ($this->options['backtrace_filters'] as $pattern => $replacement) {
            $str = preg_replace($pattern, $replacement, $str);
        }

        return $str;
    }
498347
protected static function filterAttributes($str)
    {
        $out = '';
        if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches)) {
            foreach ($matches[ 0 ] as $match) {
                $out .= preg_replace('#/\*.*?\*/#s', '', $match);
            }
        }

        return $out;
    }
170971
public static function get(string $str):array
    {
        $str = trim($str);
        $strArr = Str::toArray($str);
        $results = [];
        foreach ($strArr as $s) {
            $results[] = self::getSingle($s);
        }
        return $results;
    }
700455
private function parseAddresses($list) {
        $addresses = [];

        foreach ($list as $item) {
            $address = (object) $item;

            if (!property_exists($address, 'mailbox')) {
                $address->mailbox = false;
            }
            if (!property_exists($address, 'host')) {
                $address->host = false;
            }
            if (!property_exists($address, 'personal')) {
                $address->personal = false;
            }

            $personalParts = imap_mime_header_decode($address->personal);

            $address->personal = '';
            foreach ($personalParts as $p) {
                $address->personal .= $p->text;
            }

            $address->mail = ($address->mailbox && $address->host) ? $address->mailbox.'@'.$address->host : false;
            $address->full = ($address->personal) ? $address->personal.' <'.$address->mail.'>' : $address->mail;

            $addresses[] = $address;
        }

        return $addresses;
    }
315973
protected function extractNodeFromBBCode($str)
    {
        $references = array();
        /** @var \OpenOrchestra\BBcodeBundle\Parser\BBcodeParserInterface $parserBBcode */
        $parsedBBcode = $this->bbcodeParser->parse($str);
        $nodeTags = $parsedBBcode->getElementByTagName(InternalLinkDefinition::TAG_NAME);
        /** @var \OpenOrchestra\BBcodeBundle\ElementNode\BBcodeElementNodeInterface $mediaTag */
        foreach ($nodeTags as $nodeTag) {
            $linkAttribute = json_decode(html_entity_decode($nodeTag->getAttribute()['link']), true);
            $nodeId = $linkAttribute['site']['nodeId'];
            $siteId = $linkAttribute['site']['siteId'];
            $references[] = array('nodeId' => $nodeId, 'siteId' => $siteId);
        }
        return $references;
    }
1132464
public function seeTextInEmail($str)
    {
        $this->assertTrue($this->contains($str, $this->driver->getStringsByEmail($this->getCurrentMail())));
    }
380468
public static function isTagged(string $str): bool
    {
        return isset($str[1]) && strpos($str, '@') === 0 && ctype_alpha($str[1]);
    }
979581
protected function checkAr($str) 
    {
        $lines  = $this->_arLogodd;
        $logodd = array();
        
        $line   = array_shift($lines);
        $line   = rtrim($line);
        $second = preg_split("/\t/", $line);
        $temp   = array_shift($second);
        
        foreach ($lines as $line) {
            $line   = rtrim($line);
            $values = preg_split("/\t/", $line);
            $first  = array_shift($values);
            
            for ($i=0; $i<37; $i++) {
                $logodd["$first"]["{$second[$i]}"] = $values[$i];
            }
        }
        
        $max  = mb_strlen($str, 'UTF-8');
        $rank = 0;
        
        for ($i=1; $i<$max; $i++) {
            $first  = mb_substr($str, $i-1, 1, 'UTF-8');
            $second = mb_substr($str, $i, 1, 'UTF-8');
     
            if (isset($logodd["$first"]["$second"])) {
                $rank += $logodd["$first"]["$second"]; 
            } else {
                $rank -= 10;
            }
        }

        return $rank;
    }
532975
public static function stripAll($str)
	{
		return self::stripScripts(
			self::stripImages(
				self::stripTags(
					self::stripWhitespace($str)
				)
			)
		);
	}