device replacement for user agent
I have the following user agent which I want to extract Device information (mountain lion on MAC as I understand) from, but can't find any way or suitable regex from the existing file. anyone has an idea?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/6.2.8 Safari/537.85.17
Thanks all.
The parsing result is as follows:
ua: { family: 'Safari', major: '6', minor: '2', patch: '8' },
os:
{ family: 'Mac OS X',
major: '10',
minor: '8',
patch: '5',
patchMinor: null },
device: { family: 'Other', brand: null, model: null } }
The only interesting information we get is the OS but we cannot determine the device itself. We cannot say if it's a MacBook or a Mac. Well we could detect that the device is a Desktop computer. But that's it.
thanks for the answer. what will be the implementation for getting result for Device = 'Desktop Computer' or 'MAC'?
It could be
- regex: '\(Macintosh; Intel '
model_replacement: ''
device_replacement: 'Mac'
in the device_parsers: section