3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump( preg_match('/(?:http){1}(?:s)?\:\/\/([A-z0-9\-\.]+)+(?:\/)?(?:.*)/', 'http://vb.com/#user/id/1696/mode/photo/id-media/88905', $matches), $matches ); var_dump( preg_match('/(?:http){1}(?:s)?\:\/\/([A-z0-9\-\.]+)+(?:\/)?(?:.*)/', 'https://vb.com', $matches), $matches );
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(1) array(2) { [0]=> string(53) "http://vb.com/#user/id/1696/mode/photo/id-media/88905" [1]=> string(6) "vb.com" } int(1) array(2) { [0]=> string(14) "https://vb.com" [1]=> string(6) "vb.com" }