3v4l.org

run code in 300+ PHP versions simultaneously
<?php $expr = '#[a-z][a-z0-9.]*://(?:[^:@]+(?:[^@]+)?@)?[^:/]+(?::[0-9]+)?/([^/]+)#'; $str = 'http://dontmatchthis.local/butmatchthisplease'; preg_match($expr, $str, $matches); var_dump($matches);

preferences:
44.63 ms | 402 KiB | 5 Q