Creates a pattern with the version prefix pattern.

@param string $pattern The pattern without '/'

@return string The full pattern with '/'
349365
public static function createPattern($pattern)
    {
        $numVer = '([0-9]+|x|\*)';
        $numVer2 = '('.$numVer.'\.'.$numVer.')';
        $numVer3 = '('.$numVer.'\.'.$numVer.'\.'.$numVer.')';

        return '/^'.'('.$numVer.'|'.$numVer2.'|'.$numVer3.')'.$pattern.'/';
    }
617436
public function notName(string $pattern): self
    {
        $filter = new Iterator\FilenameFilterIterator($this->getIterator(), [], [$pattern]);

        return new self(iterator_to_array($filter));
    }
1239749
private function setBaseRoute($pattern)
    {
        $pattern = $this->routeBasePath . '/' . trim($pattern, '/');

        return $this->routeBasePath ? rtrim($pattern, '/') : $pattern;
    }
636542
protected function normalizeRegexPattern($pattern)
    {
        if (false !== @preg_match($pattern, null)) {
            return $pattern;
        }

        $boundedPattern = '~\b' . str_replace('~', '\~', $pattern) . '\b~';

        if (false !== @preg_match($boundedPattern, null)) {
            return $boundedPattern;
        }

        return '~\b' . preg_quote($pattern, '~') . '\b~';
    }
483997
protected function glob_keys_pattern($prefix = '') {
        if ($this->singledirectory) {
            return $this->path . '/'.$prefix.'*.cache';
        } else {
            return $this->path . '/*/'.$prefix.'*.cache';
        }
    }
734034
protected function buildNameRegex($name, $pattern, $suffix)
    {
        $optional = '';
        $slash = substr($name, 0, 1);

        if (in_array($slash, ['/', '-'])) {
            $prefix = '\\' . $slash;
            $name = substr($name, 1);
            $slash = substr($name, 0, 1);
        } else {
            $prefix = '';
        }

        if ('<' != $slash) {
            return $prefix . preg_quote($name, '/');
        }

        if (strpos($name, '?')) {
            $name = substr($name, 1, -2);
            $optional = '?';
        } elseif (strpos($name, '>')) {
            $name = substr($name, 1, -1);
        }

        if (isset($pattern[$name])) {
            $nameRule = $pattern[$name];
            if (0 === strpos($nameRule, '/') && '/' == substr($nameRule, -1)) {
                $nameRule = substr($nameRule, 1, -1);
            }
        } else {
            $nameRule = $this->getConfig('app.default_route_pattern');
        }
        
        return '(' . $prefix . '(?<' . $name . $suffix . '>' . $nameRule . '))' . $optional;
    }
919477
public function resolveGroup($pattern)
	{
		$type = @get_class($pattern) ? : gettype($pattern);

        try {
            $router = $this->group->factory->resolveGroup($pattern, $this);
        } catch (InvalidArgumentException $e) {
            $route = $this->getAbsoluteName();

            $pattern = is_string($pattern) ? ' (' . $pattern . ')' : '';

            throw new \Exedra\Exception\InvalidArgumentException('Unable to resolve group [' . $type . $pattern . '] on route @' . $route . '.');
        }

        if(!$router)
            throw new \Exedra\Exception\InvalidArgumentException('Unable to resolve route group ['.$type.']. It must be type of \Closure, string, or array');

        $this->properties['subroutes'] = $router;

        return $router;
	}
500021
protected function splitRoutePattern($pattern)
    {
        if (strpos($pattern, ' ') !== false && preg_match_all('/\s+\+(\w+)\b|\s+\-(\w+)\b/', $pattern, $matches)) {
            list($path) = preg_split('/\s+/', $pattern, 2);
            $inc = isset($matches[1]) ? array_filter($matches[1]) : [];
            $excl = isset($matches[2]) ? array_filter($matches[2]) : [];
        } else {
            $path = $pattern;
            $inc = [];
            $excl = [];
        }
        
        return [$path, $inc, $excl];
    }
513848
protected function removeQuantifier($pattern)
	{
		if (strripos($pattern, '+') !== false && strripos($pattern, '\+') === false)
		{
			return rtrim($pattern, '+');
		}
		if (strripos($pattern, '*') !== false && strripos($pattern, '\*') === false)
		{
			return rtrim($pattern, '*');
		}
		if (strripos($pattern, '?') !== false && strripos($pattern, '\?') === false)
		{
			return rtrim($pattern, '?');
		}

		return $pattern;
	}
155840
public static function checkRegexPattern($pattern)
  {
    $check = @preg_match($pattern, "anything"); // thats the easy way to check a pattern ;)
    if (is_integer($check) == false) return false;
    else return true;
  }
933689
private function pattern_to_regex($pattern)
    {
        if (substr($pattern, -1) == '/') {
            $pattern .= '**';
        }

        $regex = '|^';
        foreach (explode('/', $pattern) as $i => $piece) {
            if ($i > 0) {
                $regex .= preg_quote('/', '|');
            }

            if ('**' == $piece) {
                $regex .= '.*';
            } else {
                $regex .= str_replace(array('?', '*'), array('[^/]', '[^/]*'), $piece);
            }
        }
        $regex .= '$|';

        return $regex;
    }
1274071
public function vPhone(String $pattern = NULL)
    {
        return $this->setJavascriptValidation('ZNValidationPhone', 'phone', ['phone' => $pattern], [Base::presuffix($pattern, '\'')]);
    }
223467
private static function _normalize($pattern)
    {
        return self::$_delimiter . trim($pattern, self::$_delimiter)
            . self::$_delimiter;
    }
548089
public static function getRoute($pattern) {
        $route = null;
        if (isset(self::$routes[$pattern])) {
            $route = self::$routes[$pattern];
        }
        return $route;
    }
197389
public function getPattern($name = '')
    {
        if ('' === $name) {
            return $this->pattern;
        }

        return isset($this->pattern[$name]) ? $this->pattern[$name] : null;
    }
1315721
public function doAddPattern($pattern)
    {
        if (0 === strpos($pattern, '!')) {
            $searchPattern = substr($pattern, 1);
            $this->finder->notPath(Glob::toRegex($searchPattern, true, true));

            $pathComponents = explode('/', $searchPattern);

            if (1 < \count($pathComponents)) {
                $parentDirectories = \array_slice($pathComponents, 0, -1);
                $basePath = '';

                foreach ($parentDirectories as $dir) {
                    $this->finder->notPath('/\b('.preg_quote($basePath.$dir, '/').')(?!\/)\b/');
                    $basePath .= $dir.'/';
                }
            }
        } else {
            $this->finder->path(Glob::toRegex($pattern, true, true));
        }
    }
62103
protected function parsePattern($pattern)
    {
        $patterns = explode(';', $pattern);
        if (!isset($patterns[1])) {
            // No explicit negative pattern was provided, construct it.
            $patterns[1] = '-' . $patterns[0];
        }
        return $patterns;
    }