3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $re = '/([\D]+)|([\d]+)/'; $str = 'a74b8c0d3845e7'; preg_match_all($re, $str, $matches); print_r(array_filter($matches[1]));print_r(array_filter($matches[2]));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => a [2] => b [4] => c [6] => d [8] => e ) Array ( [1] => 74 [3] => 8 [7] => 3845 [9] => 7 )