code: function getLocaleFrom(req, locales) {
        if (!req || !req.headers || !req.headers.host) return false;
  
        // match the first subdomain
        if (pattern.test(req.headers.host)) {
          var locale = RegExp.$1;
          return locale;
        }
        return false;
      }
docs: gets the locale from the given strategy
  
  @param {Object} req              connect / express request object
  @param {Array} locales           locale definition Array.
  @return {Object|String|false}    Object: if it was previously stored, String: if the locale was found with the given Strategy, Boolean:false otherwise.