Here's another way of doing it:
/^(\d)(?{local ($x, $c) = ($^N, 0)}) ((\d)(?(?{$c ++; $^N == $x + $c})|\A))+$/x [download]
Abigail
In reply to Re: Code in regexp by Abigail-II in thread Code in regexp by gjb