code: function pathmap(path, spec, callback) {
    return spec.replace(regexp, function(match, replace, count, token) {
      var pattern;
      if (pattern = pathmap.patterns[token]) {
        return pattern.call(path, replace, count, callback);
      } else {
        throw new Error(
          'Unknown pathmap specifier ' + match + ' in "' + spec + '"');
      }
    });
  }
docs: Maps a path to a path spec.