3v4l.org

run code in 500+ PHP versions simultaneously
<?php $articletext = 'Here is some {gameid 55555 44444 33333} and here is some more {gameid 55555} and this is one more time {gameid 55555 33333}'; $regexgameid = '/{gameid(?:\s[0-9]{5}){1,3}}/i'; preg_match_all($regexgameid, $articletext, $matchesgameid, PREG_SET_ORDER); var_export($matchesgameid);

preferences:
22.41 ms | 475 KiB | 4 Q