Parser/ParserAbstract.php
protected function matchUserAgent($regex)
    {
        // only match if useragent begins with given regex or there is no letter before it
        $regex = '/(?:^|[^A-Z0-9\-_]|[^A-Z0-9\-]_|sprd-)(?:' . str_replace('/', '\/', $regex) . ')/i';

        if (preg_match($regex, $this->userAgent, $matches)) {
            return $matches;
        }

        return false;
    }
protected function matchUserAgent($regex)
    {
        // only match if useragent begins with given regex or there is no letter before it
        $regex = '/(?:^|[^A-Z0-9\-_]|[^A-Z0-9\-]_|sprd-)(?:' . str_replace('/', '\/', $regex) . ')/i';

        if (preg_match($regex, $this->userAgent, $matches)) {
            return $matches;
        }

        return false;
    }
protected function matchUserAgent ( $ regex ) { // only match if useragent begins with given regex or there is no letter before it $ regex = '/(?:^|[^A-Z0-9\-_]|[^A-Z0-9\-]_|sprd-)(?:' . str_replace ( '/' , '\/' , $ regex ) . ')/i' ; if ( preg_match ( $ regex , $ this -> userAgent , $ matches ) ) { return $ matches ; } return false ; }
Matches the useragent against the given regex

@param $regex
@return array|bool
Matches the useragent against the given regex