<?php

$str = "x 1 2 3 4 5"; 
$re1 = '~(?:x|(?!^)\G)\s*\K\d+~'; 
preg_match_all($re1, $str, $matches);
var_dump($matches);

$re2 = '~\d+(?:\s+\d+)*~';
if (preg_match($re2, $str, $match2)) {
	print_r(preg_split("/\\s+/", $match2[0]));
}
