2 3 , 4.0 6.1.3
/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/
Javascript:
> navigator.userAgent
"Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B146"
> navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/);
["6_1_2"]
, , , iOS.
OS X Mac.
> navigator.userAgent
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1"
> navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/);
["10_8_4"]
_ . .replace(/_/g,'.'); .split('_');.
_iOSDevice = !!navigator.platform.match(/iPhone|iPod|iPad/);
if(_iOSDevice)
_iOSVersion = (navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/)||[''])[0].replace(/_/g,'.');