user agent - Regex to detect IE9 and below? -


i trying write regex pattern in java detect if user agent less or equal internet explorer 9. there quite few examples here:

http://www.useragentstring.com/pages/internet%20explorer/

the main gist there string in user agent string called: "msie xxxx). current regex pattern this:

msie ([1-9]|9) 

which seems work except there problems when msie 10.0 or msie 11.0 matches. ideas on how match 1-9 , no 10.0 or 11?

in old versions, there dot after major version number, can use in regex :

msie [1-9]\.

another way write expect 1 number between 1 , 9 followed non number char :

msie [1-9][^0-9]


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -