3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $matches = array(); preg_match('/^(.*)-keyword-(\d+)-([\w]+)\..+$/', 'aa-bb-cc-keyword-12345-lastword.ext', $matches); var_dump($matches);
based on poXZP
Output for 4.3.0 - 7.2.0
array(4) { [0]=> string(35) "aa-bb-cc-keyword-12345-lastword.ext" [1]=> string(8) "aa-bb-cc" [2]=> string(5) "12345" [3]=> string(8) "lastword" }