Return the path pattern used when routing a request. (Tornado>=4.5)

        :param tornado.routing.Router router: (Optional) The router to scan.
            Defaults to the application's router.

        :rtype: str

def _get_path_pattern_tornado45(self, router=None):
        """Return the path pattern used when routing a request. (Tornado>=4.5)

        :param tornado.routing.Router router: (Optional) The router to scan.
            Defaults to the application's router.

        :rtype: str
        """
        if router is None:
            router = self.application.default_router
        for rule in router.rules:
            if rule.matcher.match(self.request) is not None:
                if isinstance(rule.matcher, routing.PathMatches):
                    return rule.matcher.regex.pattern
                elif isinstance(rule.target, routing.Router):
                    return self._get_path_pattern_tornado45(rule.target)