Determine if the current request URI matches a pattern.

@param  mixed  ...$patterns
@return bool
770457
public function is(...$patterns)
    {
        $path = $this->decodedPath();

        foreach ($patterns as $pattern) {
            if (Str::is($pattern, $path)) {
                return true;
            }
        }

        return false;
    }
1340747
public function match($url)
    {
        if (!$this->pattern) {
            $this->pattern = self::buildPatternFromScheme($this);
        }

        return (bool) preg_match($this->pattern, $url);
    }
872107
public function matches($path)
    {
        if (preg_match($this->expr, $path, $this->matches) &&
            in_array($_SERVER['REQUEST_METHOD'], $this->methods)) {
            return true;
        }

        return false;
    }
433624
private static function isValidRegex($pattern)
    {
        try {
            return preg_match(sprintf('~%s~', $pattern), null) !== false;
        } catch (\Exception $e) {
            return false;
        }
    }
554485
public static function Match ($pattern, $subject, array &$matches = array(), $flags = 0, $offset = 0, $from_encoding = Encoding::DEFAULT_ENCODING) {
		return Regex::match($pattern, $subject, $matches, $flags, $offset, $from_encoding);
	}
1185729
public function matchUrl($pattern)
    {
        if ($this->matchValue($this->getUrl(), $pattern)) {
            return $this->getUrl();
        }

        return false;
    }
1060422
private function match(InternalRequestInterface $request)
    {
        return !$this->hasMatcher()
            || (is_string($this->matcher) && preg_match($this->matcher, (string) $request->getUri()))
            || (is_callable($this->matcher) && call_user_func($this->matcher, $request));
    }
96090
public function routeIs(...$patterns)
    {
        if (! Arr::exists($route = $this->route()[1], 'as')) {
            return false;
        }

        foreach ($patterns as $pattern) {
            if (Str::is($pattern, $route['as'])) {
                return true;
            }
        }

        return false;
    }
983035
public function isCurrent($page, $pattern)
    {
        // Remove site URL from string
        $page = str_replace($this->getBuilder()->app->getSetting('url'), '', $page);

        return str_is($pattern, $page);
    }
741181
public static function matchesPattern($pattern, $givenString)
    {
        if ($pattern == $givenString) {
            return true;
        }

        $pattern = preg_quote($pattern, '#');
        $pattern = str_replace('\*', '.*', $pattern) . '\z';

        return (bool)preg_match('#^' . $pattern . '#', $givenString);
    }
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;
  }
751123
public static function isMatch($value, string $pattern): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        return !!preg_match($pattern, (string) $value);
    }
975847
protected function matchesPattern($pattern)
	{
		trigger_error('Function ' . __METHOD__ . ' not implemented yet');

		$regexEncoding = $this->regexEncoding();
		$this->regexEncoding($this->encoding);

		$match = \mb_ereg_match($pattern, $this->str);
		$this->regexEncoding($regexEncoding);

		return $match;
	}
35075
function indexOfPattern ($pattern)
  {
    self::toUnicodeRegex ($pattern);
    if (!preg_match ($pattern, $this->S, $m, PREG_OFFSET_CAPTURE)) return false;
    return $m[0][1];
  }
969616
public function matchUri($uri, & $matches = [])
    {
        if ($this->matchAbsoluteUri($uri, $matches)) {
            return true;
        }

        return $this->matchRelativeUri($uri, $matches);
    }
189612
public function named(...$patterns)
    {
        if (is_null($routeName = $this->getName())) {
            return false;
        }

        foreach ($patterns as $pattern) {
            if (Str::is($pattern, $routeName)) {
                return true;
            }
        }

        return false;
    }
204433
private function isValidPattern(string $pattern): bool
    {
        set_error_handler(function (int $severity, string $message, string $file, int $line): bool {
            throw new \ErrorException($message, 0, $severity, $file, $line);
        }, \E_ALL);

        try {
            $result = preg_match("/$pattern/", '');
        } catch (\ErrorException $exception) {
            $errorMessage = sprintf("Invalid regular expression '%s': %s", $pattern, $exception->getMessage());
            throw new \InvalidArgumentException($errorMessage, 0, $exception);
        } finally {
            restore_error_handler();
        }

        return $result !== false;
    }