Parse user agent