3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $expr = '#[a-z][a-z0-9.]*://(?:[^:@]+(?:[^@]+)?@)?[^:/]+(?::[0-9]+)?/([^/]+)#'; $str = 'http://dontmatchthis.local/butmatchthisplease'; preg_match($expr, $str, $matches); var_dump($matches);
Output for 4.3.0 - 7.2.0
array(2) { [0]=> string(45) "http://dontmatchthis.local/butmatchthisplease" [1]=> string(18) "butmatchthisplease" }