I’d like to extract full the OS name and browser from the user agent string. How can I do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think it is tricky to get the full OS name and full browser name since many browsers identify themselves differently. You will probably need some fancy regex and then it might not even work 100% of the time.
Here is the simple method I use to identify the browser. You may be able to adapt it to suit your needs.