code: function tokensToRegExp (tokens, keys, options) {
    options = options || {}
  
    var strict = options.strict
    var start = options.start !== false
    var end = options.end !== false
    var delimiter = options.delimiter || DEFAULT_DELIMITER
    var endsWith = [].concat(options.endsWith || []).map(escapeString).concat('$').join('|')
    var route = start ? '^' : ''
  
    // Iterate over the tokens and create our regexp string.
    for (var i = 0; i < tokens.length; i++) {
      var token = tokens[i]
  
      if (typeof token === 'string') {
        route += escapeString(token)
      } else {
        var capture = token.repeat
          ? '(?:' + token.pattern + ')(?:' + escapeString(token.delimiter) + '(?:' + token.pattern + '))*'
          : token.pattern
  
        if (keys) keys.push(token)
  
        if (token.optional) {
          if (!token.prefix) {
            route += '(' + capture + ')?'
          } else {
            route += '(?:' + escapeString(token.prefix) + '(' + capture + '))?'
          }
        } else {
          route += escapeString(token.prefix) + '(' + capture + ')'
        }
      }
    }
  
    if (end) {
      if (!strict) route += '(?:' + escapeString(delimiter) + ')?'
  
      route += endsWith === '$' ? '$' : '(?=' + endsWith + ')'
    } else {
      var endToken = tokens[tokens.length - 1]
      var isEndDelimited = typeof endToken === 'string'
        ? endToken[endToken.length - 1] === delimiter
        : endToken === undefined
  
      if (!strict) route += '(?:' + escapeString(delimiter) + '(?=' + endsWith + '))?'
      if (!isEndDelimited) route += '(?=' + escapeString(delimiter) + '|' + endsWith + ')'
    }
  
    return new RegExp(route, flags(options))
  }
docs: Expose a function for taking tokens and returning a RegExp.
  
  @param  {!Array}  tokens
  @param  {Array=}  keys
  @param  {Object=} options
  @return {!RegExp}