3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = array('40_'); if (preg_match('/^(\d{1,})_$/', reset($var), $match)) { var_dump($match); }

preferences:
43.31 ms | 402 KiB | 5 Q