3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php preg_match('/([a-z]+)(<((?R)(,(?R))*)>)?/', 'a<b<c<d>>,g>', $matches, PREG_OFFSET_CAPTURE, 2); print_r($matches);
based on glnoW
Output for 5.5.0 - 7.3.0rc4
Array ( [0] => Array ( [0] => b<c<d>> [1] => 2 ) [1] => Array ( [0] => b [1] => 2 ) [2] => Array ( [0] => <c<d>> [1] => 3 ) [3] => Array ( [0] => c<d> [1] => 4 ) )