3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i = '4N4P9N7P1N1P2N2P'; preg_match_all('/(\d+)(\w)/', $i, $m); print_r($m);
Output for 4.3.0 - 7.2.0
Array ( [0] => Array ( [0] => 4N [1] => 4P [2] => 9N [3] => 7P [4] => 1N [5] => 1P [6] => 2N [7] => 2P ) [1] => Array ( [0] => 4 [1] => 4 [2] => 9 [3] => 7 [4] => 1 [5] => 1 [6] => 2 [7] => 2 ) [2] => Array ( [0] => N [1] => P [2] => N [3] => P [4] => N [5] => P [6] => N [7] => P ) )