class_docstr: Specifies mappings between URLs and handlers.
  
  .. versionchanged: 4.5
     `URLSpec` is now a subclass of a `Rule` with `PathMatches` matcher and is preserved for
     backwards compatibility.
class_docstr_tok: ["Specifies","mappings","between","URLs","and","handlers",".","..","versionchanged",":","4.5","`","URLSpec","`","is","now","a","subclass","of","a","`","Rule","`","with","`","PathMatches","`","matcher","and","is","preserved","for","backwards","compatibility","."]
docstr: Parameters:
  
  * ``pattern``: Regular expression to be matched. Any capturing
    groups in the regex will be passed in to the handler's
    get/post/etc methods as arguments (by keyword if named, by
    position if unnamed. Named and unnamed capturing groups may
    may not be mixed in the same rule).
  
  * ``handler``: `~.web.RequestHandler` subclass to be invoked.
  
  * ``kwargs`` (optional): A dictionary of additional arguments
    to be passed to the handler's constructor.
  
  * ``name`` (optional): A name for this handler.  Used by
    `~.web.Application.reverse_url`.
docstr_tok: ["Parameters",":","*","``","pattern","``",":","Regular","expression","to","be","matched",".","Any","capturing","groups","in","the","regex","will","be","passed","in","to","the","handler's","get\/post\/etc","methods","as","arguments","(","by","keyword","if","named",",","by","position","if","unnamed",".","Named","and","unnamed","capturing","groups","may","may","not","be","mixed","in","the","same","rule",")",".","*","``","handler","``",":","`","~.web.RequestHandler","`","subclass","to","be","invoked",".","*","``","kwargs","``","(","optional",")",":","A","dictionary","of","additional","arguments","to","be","passed","to","the","handler","'s","constructor",".","*","``","name","``","(","optional",")",":","A","name","for","this","handler",".","Used","by","`","~.web.Application.reverse_url","`","."]
code: def __init__(self, pattern, handler, kwargs=None, name=None):
      """Parameters:
  
      * ``pattern``: Regular expression to be matched. Any capturing
        groups in the regex will be passed in to the handler's
        get/post/etc methods as arguments (by keyword if named, by
        position if unnamed. Named and unnamed capturing groups may
        may not be mixed in the same rule).
  
      * ``handler``: `~.web.RequestHandler` subclass to be invoked.
  
      * ``kwargs`` (optional): A dictionary of additional arguments
        to be passed to the handler's constructor.
  
      * ``name`` (optional): A name for this handler.  Used by
        `~.web.Application.reverse_url`.
  
      """
      super(URLSpec, self).__init__(
          PathMatches(pattern), handler, kwargs, name
      )
  
      self.regex = self.matcher.regex
      self.handler_class = self.target
      self.kwargs = kwargs
  
imports: from __future__ import absolute_import, division, print_function
  import re
  from functools import partial
  from tornado import httputil
  from tornado.httpserver import _CallableAdapter
  from tornado.escape import url_escape, url_unescape, utf8
  from tornado.log import app_log
  from tornado.util import basestring_type, import_object, re_unescape, unicode_type
label_desc: Use image node_id 1 to create a new URLSpec object from inherited base classes: Rule with example: obj = URLSpec(pattern, handler, kwargs, name)