public function matches(string $string, string $pattern): bool
    {
        if ($string === $pattern) {
            return true;
        }
        if (!$this->isPattern($pattern)) {
            return false;
        }
        return (bool)preg_match($this->getRegex($pattern), $string);
    }