3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19'; $pattern = "/Android (\d).(\d).(\d)/"; preg_match($pattern, $a, $matches); print_r($matches);
based on BXpnK
Output for 4.3.0 - 7.1.0
Array ( [0] => Android 4.0.4 [1] => 4 [2] => 0 [3] => 4 )