3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "01/11/2016 Aggregated Micro Power Holdings plc (AMPH) JPMorgan Global Growth & Income plc (JPGI) Murray Income Trust plc (MUT)"; preg_match('/(\d+\/\d+\/\d+)\s/', $string, $match); $date = trim($match[0]); $string = substr($string,strlen($match[0])); preg_match_all('/\G(?P<name>.*)?\((?P<abbr>.*)?\)/', $string, $firms); //$firms = preg_split('/\)\s/',$string); var_dump($firms);
based on 1Fvpg
Output for 5.6.0 - 7.3.0alpha1
array(5) { [0]=> array(1) { [0]=> string(115) "Aggregated Micro Power Holdings plc (AMPH) JPMorgan Global Growth & Income plc (JPGI) Murray Income Trust plc (MUT)" } ["name"]=> array(1) { [0]=> string(110) "Aggregated Micro Power Holdings plc (AMPH) JPMorgan Global Growth & Income plc (JPGI) Murray Income Trust plc " } [1]=> array(1) { [0]=> string(110) "Aggregated Micro Power Holdings plc (AMPH) JPMorgan Global Growth & Income plc (JPGI) Murray Income Trust plc " } ["abbr"]=> array(1) { [0]=> string(3) "MUT" } [2]=> array(1) { [0]=> string(3) "MUT" } }