'Check if the rule matches a given path. Path is a string in the
form ``"subdomain|/path"`` and is assembled by the map.  If
the map is doing host matching the subdomain part will be the host
instead.
If the rule matches a dict with the converted values is returned,
otherwise the return value is `None`.
:internal:'

def match(self, path, method=None):

    if (not self.build_only):
        m = self._regex.search(path)
        if (m is not None):
            groups = m.groupdict()
            if (self.strict_slashes and (not self.is_leaf) and (not groups.pop('__suffix__')) and ((method is None) or (self.methods is None) or (method in self.methods))):
                raise RequestSlash()
            elif (not self.strict_slashes):
                del groups['__suffix__']
            result = {}
            for (name, value) in iteritems(groups):
                try:
                    value = self._converters[name].to_python(value)
                except ValidationError:
                    return
                result[str(name)] = value
            if self.defaults:
                result.update(self.defaults)
            if (self.alias and self.map.redirect_defaults):
                raise RequestAliasRedirect(result)
            return result
