3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = '/var/www/vb_dev/frontend/web/img/up/bf9b12de5ea78cecacd3dde69f2a72f8/676/6dc6c807e1cef2ba8af8e422abe77286/5/l.jpg'; preg_match('/(.*)\/img\/up\/(.*)\.jpg/', $s, $matches); var_dump($matches); $s = '/img/up/bf9b12de5ea78cecacd3dde69f2a72f8/676/6dc6c807e1cef2ba8af8e422abe77286/5/l.jpg'; preg_match('/(.*)\/img\/up\/(.*)\.jpg/', $s, $matches2); var_dump($matches2);
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(113) "/var/www/vb_dev/frontend/web/img/up/bf9b12de5ea78cecacd3dde69f2a72f8/676/6dc6c807e1cef2ba8af8e422abe77286/5/l.jpg" [1]=> string(28) "/var/www/vb_dev/frontend/web" [2]=> string(73) "bf9b12de5ea78cecacd3dde69f2a72f8/676/6dc6c807e1cef2ba8af8e422abe77286/5/l" } array(3) { [0]=> string(85) "/img/up/bf9b12de5ea78cecacd3dde69f2a72f8/676/6dc6c807e1cef2ba8af8e422abe77286/5/l.jpg" [1]=> string(0) "" [2]=> string(73) "bf9b12de5ea78cecacd3dde69f2a72f8/676/6dc6c807e1cef2ba8af8e422abe77286/5/l" }