private function toRegex($string) { return $this->isRegex($string) ? $string : Glob::toRegex($string); }