title: Backbone.js parse optional page query string in router
body: <p>I'm moving my django implementation slowly to backbonejs rendering. Django is used as a fallback when backbonejs rendering cannot handle. This is taken care by backbonejs router using the following code.</p>
  
  <pre><code>Backbone.history.start({
      pushState: true,
      silent: true
  });
  
  $(document).on("click", "a[href^='/']", function(event) { 
    if (!event.altKey &amp;&amp; !event.ctrlKey &amp;&amp; !event.metaKey &amp;&amp; !event.shiftKey) { 
      var url = $(event.currentTarget).attr("href").replace(/^\//, "");
      var matched = _.any(Backbone.history.handlers, function(handler) { 
        if (handler.route.test(url)) { 
          return true;
        } 
      });
  
      if (matched) { 
        event.preventDefault();
        application.router.navigate(url, { trigger: true });
      } 
    } 
  });
  </code></pre>
  
  <p>Basically if backbone routers cannot handle it will fallback to django template rendering. But I'm now unable to catch pages which are paginated. I've the following routing defined.</p>
  
  <pre><code>module.exports = Backbone.Router.extend({
  
    routes: {
      'set/(?page=:page)': 'list_set'
    },
  
    list_set: function(page) {
      // Do listing of set
    }
  });
  </code></pre>
  
  <p>I would prefer urls with <code>set/?page=2</code> to get triggered by Backbone.js. But the above route fails to match. What is the routing pattern which will make page parameter optional and also make backbonejs handle routing?</p>