3v4l.org

run code in 300+ PHP versions simultaneously
<?php preg_match_all("/([0-9]+)(?:\[(.*)\])?A/", "123[SomeText]A345[SomeOtherText]A678A", $matches); print_r($matches);

preferences:
38.17 ms | 402 KiB | 5 Q