3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match("/([a-z]*)\*?\(([^\)]+)\)\*?([a-z]*)/", "a+(c+d)*bb+a", $matches); var_dump($matches);
based on h3eIb
Output for 4.3.0 - 7.1.0
array(4) { [0]=> string(8) "(c+d)*bb" [1]=> string(0) "" [2]=> string(3) "c+d" [3]=> string(2) "bb" }