3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "https://test.com/file/5gdxyYpb#_FWRc4T12baPrppZIwVQ5i18Sq16f7TXU82LJwY_BjE"; $pattern = "~https?://.*/\K([^#\s]+)#(\S+)~"; $res = preg_match($pattern, $url, $matches); print_r($matches);

preferences:
14.88 ms | 402 KiB | 5 Q