private function matchValue($value, $pattern)
    {
        // basic check
        if ($value == $pattern) {
            return true;
        }

        // simple check in case of optional param
        if ($pattern == '?') {
            return true;
        }

        // simple match in case pattern is just "*"
        if ($pattern == '*' && $value != '') {
            return true;
        }

        // more complex match in case when wildcard is part of a larger match
        $pattern = str_replace('*', '(.+)', $pattern);

        // regex match
        if (strpos($pattern, '(') !== false || strpos($pattern, '[') !== false || strpos($pattern, '\\') !== false) {
            return preg_match('#^' . $pattern . '$#', $value);
        }

        return false;
    }
private function matchValue($value, $pattern)
    {
        // basic check
        if ($value == $pattern) {
            return true;
        }

        // simple check in case of optional param
        if ($pattern == '?') {
            return true;
        }

        // simple match in case pattern is just "*"
        if ($pattern == '*' && $value != '') {
            return true;
        }

        // more complex match in case when wildcard is part of a larger match
        $pattern = str_replace('*', '(.+)', $pattern);

        // regex match
        if (strpos($pattern, '(') !== false || strpos($pattern, '[') !== false || strpos($pattern, '\\') !== false) {
            return preg_match('#^' . $pattern . '$#', $value);
        }

        return false;
    }
private function matchValue ( $ value , $ pattern ) { // basic check if ( $ value == $ pattern ) { return true ; } // simple check in case of optional param if ( $ pattern == '?' ) { return true ; } // simple match in case pattern is just "*" if ( $ pattern == '*' && $ value != '' ) { return true ; } // more complex match in case when wildcard is part of a larger match $ pattern = str_replace ( '*' , '(.+)' , $ pattern ) ; // regex match if ( strpos ( $ pattern , '(' ) !== false || strpos ( $ pattern , '[' ) !== false || strpos ( $ pattern , '\\' ) !== false ) { return preg_match ( '#^' . $ pattern . '$#' , $ value ) ; } return false ; }
Method that tries to match the given pattern to the given value.

@param string $value Value where the pattern match will be performed.
@param string $pattern Pattern to match.

@return bool True if pattern matched the value, otherwise false.
Method that tries to match the given pattern to the given value .