ua-parser / uap-core

The regex file necessary to build language ports of Browserscope's user agent parser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[regression] in mac os version detection

kares opened this issue · comments

given the following pattern: MacOutlook/16.24.0.190414 (Intelx64 Mac OS X Version 10.14.4 (Build 18E226))
since 0.11.0 the OS version is no longer extracted as 10.14.4 but matches the "Build" part: as 18.2.6 (major.minor.patch)

this worker prior to 0.11.0 correctly and can be traced back to this regex change:

-  - regex: '\w+\s+Mac OS X\s+\w+\s+(\d+).(\d+).(\d+).*'
+  - regex: 'Mac OS X\s.{1,50}\s(\d+).(\d+).(\d+)'

.. one potential work-around is to make the \s part non greedy e.g. Mac OS X\s.{1,50}?\s(\d+).(\d+).(\d+)