3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "test string (test.url.com) abcdef java.lang.Assertion uvwxyz www.google.com abcdef", "another test string /abc/xyz/lib/def/GH.tr test 200." ]; $strings = array_map(function($x) { preg_match_all('~\bjava(?:\.\w+)+(*SKIP)(*FAIL)|(?<!/)\b\w+(?:\.\w+)+~', $x, $matches); return $matches[0]; }, $strings); print_r($strings);

preferences:
26.24 ms | 406 KiB | 5 Q