Get the vhost data of the request for RegExp

@param (object} req
@param (RegExp} regexp
@return {object}
@private
function vhostof (req, regexp, subsite) {
  var host = req.headers.host
  var hostname = hostnameof(req)

  if (!hostname) {
    return
  }

  var match = regexp.exec(hostname)

  if (!match) {
    return
  }

  if (subsite && 'IS_ROUTE' != subsite && !_.startsWith(req.path, subsite+'/', 1)
    && (req.get('X-Base-Url-Path') != subsite)) {
    return
  }

  var obj = Object.create(null)

  obj.host = host
  obj.hostname = hostname
  obj.length = match.length - 1

  for (var i = 1; i < match.length; i++) {
    obj[i - 1] = match[i]
  }

  return obj
}