3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '/server localhost:3306 root:some pass with spaces & a : colon'; preg_match('~/server ([^:]+):(\d+) (.+)~', $string, $m); array_shift($m); // remove the fullstring match var_export($m);

preferences:
173.25 ms | 406 KiB | 5 Q