3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php preg_match('/^(s3\:\/\/[0-9A-z\-\_\.]+\@[0-9A-z\-\.]+\.com)\/(.*)\/([0-9A-z]+\.(jpg|png|jpeg|gif|bmp))$/', 's3://aqadd.com.ssrmap@s3-eu-west-1.amazonaws.com/listings/17/28/2385fd6a3c3a036c0e41eaf6c6654839.jpg', $matches); list($path, $endpoint, $directory, $filename, $ext) = $matches; var_dump($filename); var_dump($directory);
based on BHuUm
Output for 4.3.0 - 7.2.0
string(36) "2385fd6a3c3a036c0e41eaf6c6654839.jpg" string(14) "listings/17/28"