3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hit = []; $str = '/answer 56 this is my sample text'; preg_match('/^\/answer ([1-9][0-9]*) (.{1,512})$/', $str, $hit, PREG_OFFSET_CAPTURE); echo'<pre>',print_r($hit),'</pre>'; // TODO

preferences:
33.65 ms | 405 KiB | 6 Q