3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match('#^((http:|https:)?//(.+\.)?klm\.com|/[^/]).*$#s', 'http://klm.com/smth', $m); var_dump($m); preg_match('#^((http:|https:)?//(.+\.)?klm\.com|/[^/]).*$#s', '/RU/ru/local/air-france/monde/index.htm', $m); var_dump($m);
based on O2mm9
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { [0]=> string(19) "http://klm.com/smth" [1]=> string(14) "http://klm.com" [2]=> string(5) "http:" } array(2) { [0]=> string(39) "/RU/ru/local/air-france/monde/index.htm" [1]=> string(2) "/R" }