public static function uriMatch($pattern, $uri = null)
    {
        if ($uri === null) {
            $uri = self::get('request_uri');
        }
        $uri = trim($uri, '/');
        $pattern = trim($pattern, '/');
        
        $regexp = $pattern;
        if ($pattern{0} != '#') {
            $regexp = '#^' . str_replace('*', '(.*)', $pattern) . '$#';
        }
        
        return (bool) preg_match($regexp, $uri);
    }
public static function uriMatch($pattern, $uri = null)
    {
        if ($uri === null) {
            $uri = self::get('request_uri');
        }
        $uri = trim($uri, '/');
        $pattern = trim($pattern, '/');
        
        $regexp = $pattern;
        if ($pattern{0} != '#') {
            $regexp = '#^' . str_replace('*', '(.*)', $pattern) . '$#';
        }
        
        return (bool) preg_match($regexp, $uri);
    }
public static function uriMatch ( $ pattern , $ uri = null ) { if ( $ uri === null ) { $ uri = self :: get ( 'request_uri' ) ; } $ uri = trim ( $ uri , '/' ) ; $ pattern = trim ( $ pattern , '/' ) ; $ regexp = $ pattern ; if ( $ pattern { 0 } != '#' ) { $ regexp = '#^' . str_replace ( '*' , '(.*)' , $ pattern ) . '$#' ; } return ( bool ) preg_match ( $ regexp , $ uri ) ; }
Checks if an uri matches the pattern.

The pattern can contain the * wildcard in any segment.
For example "users/*" will match all child actions of users.
If you want to match users and its children use "users*".

Pattern is considered a regular expression if enclosed
between # (example: "#users/(.*)#")

@param string $pattern
@param string $uri Default is the current request uri
@return bool
Checks if an uri matches the pattern .