protected function getQueryInstanceFromQueryString($queryString)
    {
        if (preg_match('/^[ \r\n\t\f]*(?:(only[ \r\n\t\f]+)|(not[ \r\n\t\f]+))?([^ \r\n\t\f]*)[ \r\n\t\f]*(?:(?:and)?[ \r\n\t\f]*)*$/iD', $queryString, $matches)) {
            $type = $matches[3] === "" ? MediaQuery::TYPE_ALL : $matches[3];
            $query = new MediaQuery($type);
            if (!empty($matches[1])) {
                $query->setIsOnly(true);
            }
            if (!empty($matches[2])) {
                $query->setIsNot(true);
            }
            return $query;
        }
        return null;
    }